From af1903fe3f41acb79acfba6463615dff87abde01 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Wed, 3 Nov 2021 09:10:38 +0100 Subject: [PATCH] nm-device: prefer manually configured addresses to automatic This bumps L3_CONFIG_DATA_TYPE_MANUALIP to be the most important address source; which is what had been the case before NetworkManager/next and is presumably what the user expects. It also comes into play for iBFT-booted machines, where iBFT contains a permanent address (no lifetime data), while DHCP might lease out the same one. In that case, expiry of the latter could potentially disrupt connectivity to a vital storage volume. Fixes: 14962cb414f6 ('merge: branch 'next''): https://bugzilla.redhat.com/show_bug.cgi?id=2013921 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1011 --- src/core/devices/nm-device.c | 4 ++-- src/core/nm-l3cfg.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c index 6f104b5b8d..6db28f4dd0 100644 --- a/src/core/devices/nm-device.c +++ b/src/core/devices/nm-device.c @@ -139,6 +139,8 @@ typedef enum { * their relative order matters: higher numbers in this enum means more * important (and during merge overwrites other settings). */ + L3_CONFIG_DATA_TYPE_MANUALIP, + L3_CONFIG_DATA_TYPE_LL_4, L3_CONFIG_DATA_TYPE_LL_6, @@ -181,8 +183,6 @@ typedef enum { _t; \ }) - L3_CONFIG_DATA_TYPE_MANUALIP, - _L3_CONFIG_DATA_TYPE_NUM, _L3_CONFIG_DATA_TYPE_NONE, _L3_CONFIG_DATA_TYPE_ACD_ONLY, diff --git a/src/core/nm-l3cfg.h b/src/core/nm-l3cfg.h index a7d89a2618..d994efde32 100644 --- a/src/core/nm-l3cfg.h +++ b/src/core/nm-l3cfg.h @@ -6,8 +6,8 @@ #include "libnm-platform/nmp-object.h" #include "nm-l3-config-data.h" -#define NM_L3CFG_CONFIG_PRIORITY_IPV4LL 0 -#define NM_L3CFG_CONFIG_PRIORITY_IPV6LL 0 +#define NM_L3CFG_CONFIG_PRIORITY_IPV4LL 1 +#define NM_L3CFG_CONFIG_PRIORITY_IPV6LL 1 #define NM_ACD_TIMEOUT_RFC5227_MSEC 9000u #define NM_TYPE_L3CFG (nm_l3cfg_get_type())