Commit 3635f462 authored by Thomas Haller's avatar Thomas Haller

device: detect loopback device explicitly

Don't use NM_UNMANAGED_LOOPBACK for that.
parent baa00083
...@@ -80,6 +80,8 @@ ...@@ -80,6 +80,8 @@
#include "nm-audit-manager.h" #include "nm-audit-manager.h"
#include "nm-connectivity.h" #include "nm-connectivity.h"
#include "nm-dbus-interface.h" #include "nm-dbus-interface.h"
#include "nm-device-generic.h"
#include "nm-device-vlan.h" #include "nm-device-vlan.h"
#include "nm-device-logging.h" #include "nm-device-logging.h"
...@@ -823,6 +825,13 @@ _ethtool_state_set (NMDevice *self) ...@@ -823,6 +825,13 @@ _ethtool_state_set (NMDevice *self)
/*****************************************************************************/ /*****************************************************************************/
static gboolean
is_loopback (NMDevice *self)
{
return NM_IS_DEVICE_GENERIC (self)
&& NM_DEVICE_GET_PRIVATE (self)->ifindex == 1;
}
NMSettings * NMSettings *
nm_device_get_settings (NMDevice *self) nm_device_get_settings (NMDevice *self)
{ {
...@@ -2460,7 +2469,7 @@ concheck_is_possible (NMDevice *self) ...@@ -2460,7 +2469,7 @@ concheck_is_possible (NMDevice *self)
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
if ( !nm_device_is_real (self) if ( !nm_device_is_real (self)
|| NM_FLAGS_HAS (priv->unmanaged_flags, NM_UNMANAGED_LOOPBACK)) || is_loopback (self))
return FALSE; return FALSE;
/* we enable periodic checks for every device state (except UNKNOWN). Especially with /* we enable periodic checks for every device state (except UNKNOWN). Especially with
...@@ -4292,7 +4301,7 @@ realize_start_setup (NMDevice *self, ...@@ -4292,7 +4301,7 @@ realize_start_setup (NMDevice *self,
/* Unmanaged the loopback device with an explicit NM_UNMANAGED_LOOPBACK flag. /* 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 * 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. */ * NetworkManager might down the interface or remove the 127.0.0.1 address. */
nm_device_set_unmanaged_flags (self, NM_UNMANAGED_LOOPBACK, priv->ifindex == 1); nm_device_set_unmanaged_flags (self, NM_UNMANAGED_LOOPBACK, is_loopback (self));
nm_device_set_unmanaged_by_user_udev (self); nm_device_set_unmanaged_by_user_udev (self);
nm_device_set_unmanaged_by_user_conf (self); nm_device_set_unmanaged_by_user_conf (self);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment