device: add explicit NM_UNMANAGED_LOOPBACK flag for not managing "lo"

This commit is contained in:
Thomas Haller
2015-09-15 14:06:15 +02:00
parent a33fc00239
commit fd8dde5c68
2 changed files with 6 additions and 6 deletions

View File

@@ -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;

View File

@@ -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,