device: add explicit NM_UNMANAGED_LOOPBACK flag for not managing "lo"
This commit is contained in:
@@ -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;
|
||||
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user