summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-09-15 14:06:15 +0200
committerThomas Haller <thaller@redhat.com>2015-09-16 16:36:55 +0200
commitfd8dde5c68425ceff199a4c7715eb2a64a48acb2 (patch)
tree52d9bbd110f530f276e658fffdc73c2ac0b14134
parenta33fc00239edde8a1e8ab91314e86e34a6daea2f (diff)
downloadNetworkManager-fd8dde5c68425ceff199a4c7715eb2a64a48acb2.tar.gz
device: add explicit NM_UNMANAGED_LOOPBACK flag for not managing "lo"
-rw-r--r--src/devices/nm-device.c10
-rw-r--r--src/devices/nm-device.h2
2 files changed, 6 insertions, 6 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index d4aa2ae06f..573270fcfb 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -1125,12 +1125,10 @@ nm_device_finish_init (NMDevice *self)
if (priv->ifindex > 0) {
if (priv->ifindex == 1) {
- /* keep 'lo' as default-unmanaged. */
-
- /* FIXME: either find a better way to unmange 'lo' that cannot be changed
- * by user configuration (NM_UNMANGED_LOOPBACK?) or fix managing 'lo'.
- * Currently it can happen that NM deletes 127.0.0.1 address. */
- nm_device_set_initial_unmanaged_flag (self, NM_UNMANAGED_DEFAULT, TRUE);
+ /* Unmanaged the loopback device with an explicit NM_UNMANAGED_LOOPBACK flag.
+ * Later we might want to manage 'lo' too. Currently that doesn't work because
+ * NetworkManager might down the interface or remove the 127.0.0.1 address. */
+ nm_device_set_initial_unmanaged_flag (self, NM_UNMANAGED_LOOPBACK, TRUE);
} else if (priv->platform_link_initialized || (priv->is_nm_owned && nm_device_is_software (self))) {
gboolean platform_unmanaged = FALSE;
diff --git a/src/devices/nm-device.h b/src/devices/nm-device.h
index 29d521353a..6d254d7330 100644
--- a/src/devices/nm-device.h
+++ b/src/devices/nm-device.h
@@ -412,6 +412,7 @@ RfKillType nm_device_get_rfkill_type (NMDevice *device);
* @NM_UNMANAGED_EXTERNAL_DOWN: %TRUE when unmanaged because !IFF_UP and not created by NM
* @NM_UNMANAGED_PLATFORM_INIT: %TRUE when unmanaged because platform link not
* yet initialized
+ * @NM_UNMANAGED_LOOPBACK: %TRUE for unmanaging loopback device
*/
typedef enum {
NM_UNMANAGED_NONE = 0,
@@ -421,6 +422,7 @@ typedef enum {
NM_UNMANAGED_PARENT = (1LL << 3),
NM_UNMANAGED_EXTERNAL_DOWN = (1LL << 4),
NM_UNMANAGED_PLATFORM_INIT = (1LL << 5),
+ NM_UNMANAGED_LOOPBACK = (1LL << 6),
/* Boundary value */
__NM_UNMANAGED_LAST,