NetworkManager/src/devices
Dan Williams 711a05965b core: fix re-activation of connections on EXTERNAL_DOWN interfaces (bgo #741742)
When userspace IPv6LL capability is compiled into NetworkManager,
during deactivation NM will toggle userspace IPv6LL in some cases.
This causes link change events in the platform, which show up
in nm-device.c::device_link_changed().

When an EXTERNAL_DOWN interface was activated, the EXTERNAL_DOWN
flag was never cleared even if the device was set IFF_UP or if
a connection was activated via D-Bus (which explicitly sets the
device up).

Second, the device_link_changed() code changed device state
whether or not IFF_UP had actually changed, it simply looked at
the current value.

Together, this caused the first activation of an EXTERNAL_DOWN
device to succeed, but the EXTERNAL_DOWN flag was never cleared
even though the activation set the device IFF_UP.  When a second
activation request came in, the device was moved to DISCONNECTED
state and IPv6LL genmode was reset, causing device_link_changed()
to run.  Since the device had EXTERNAL_DOWN and IFF_UP were still
set, nm_device_set_unmanaged_flag() code was triggered to clear
EXTERNAL_DOWN, which resulted in a state transition to UNAVAILABLE
with a reason of CONNECTION_ASSUMED.  This caused the second
activation request to fail because UNAVAILABLE devices cannot
activate connections by definition.

The fix has three parts:

1) Only change EXTERNAL_DOWN if IFF_UP actually changes, to prevent
spurious changes when something other than IFF_UP changes

2) Only clear EXTERNAL_DOWN when IFF_UP changes while the device
is UNMANAGED, since any state higher than UNMANAGED implies that
either an activation request was received (and thus the device
should be managed) or IFF_UP was set

3) Clear EXTERNAL_DOWN (without triggering state changes) when
any state higher than UNAVAILABLE is entered, since this implies
that a connection is activating or the device is no longer
IFF_UP

fixes:NetworkManager_Test108_testcase_303655

https://bugzilla.gnome.org/show_bug.cgi?id=741742
2014-12-19 11:04:46 -06:00
..
adsl core: fix a spurious warning with non-kernel network devices 2014-11-14 15:36:31 -05:00
bluetooth bluetooth: the code cannot be reached 2014-12-05 09:38:40 +01:00
team team: only proceed with stage2 when team device is STATE_PREPARE 2014-12-12 18:42:37 +01:00
wifi device: Deal with links that vanish during initialization 2014-12-02 11:44:49 +01:00
wimax all: consistently include config.h 2014-11-13 17:18:42 -05:00
wwan core: fix a spurious warning with non-kernel network devices 2014-11-14 15:36:31 -05:00
nm-device-bond.c libnm-core: add nm-core-types.h, remove cross-includes 2014-10-28 17:17:17 -04:00
nm-device-bond.h devices: drop device-type-specific error domains 2014-10-22 08:29:08 -04:00
nm-device-bridge.c libnm-core: add nm-core-types.h, remove cross-includes 2014-10-28 17:17:17 -04:00
nm-device-bridge.h devices: drop device-type-specific error domains 2014-10-22 08:29:08 -04:00
nm-device-ethernet-utils.c all: consistently include config.h 2014-11-13 17:18:42 -05:00
nm-device-ethernet-utils.h settings: create default wired connection from NMDeviceEthernet 2014-09-11 12:47:07 -05:00
nm-device-ethernet.c device: Deal with links that vanish during initialization 2014-12-02 11:44:49 +01:00
nm-device-ethernet.h devices: drop device-type-specific error domains 2014-10-22 08:29:08 -04:00
nm-device-factory.c all: consistently include config.h 2014-11-13 17:18:42 -05:00
nm-device-factory.h core: add support for internal device factories 2014-09-11 12:50:15 -05:00
nm-device-generic.c libnm-core: add nm-core-types.h, remove cross-includes 2014-10-28 17:17:17 -04:00
nm-device-generic.h devices: drop device-type-specific error domains 2014-10-22 08:29:08 -04:00
nm-device-gre.c libnm-core: extract NMSettingIPConfig superclass out of IP4, IP6 classes 2014-11-07 07:49:40 -05:00
nm-device-gre.h gre: port to internal device factory 2014-09-11 12:50:16 -05:00
nm-device-infiniband.c libnm-core: add nm-core-types.h, remove cross-includes 2014-10-28 17:17:17 -04:00
nm-device-infiniband.h devices: drop device-type-specific error domains 2014-10-22 08:29:08 -04:00
nm-device-logging.h device: add logging macro _LOGT() 2014-12-09 16:17:46 +01:00
nm-device-macvlan.c macvlan: port to internal device factory 2014-09-11 12:50:16 -05:00
nm-device-macvlan.h macvlan: port to internal device factory 2014-09-11 12:50:16 -05:00
nm-device-private.h device: turn nm_d_ip_config_should_fail to get_ip_config_may_fail 2014-12-11 11:46:42 +01:00
nm-device-tun.c core: fix 'tun' device owner/group property getters 2014-09-19 12:07:00 -05:00
nm-device-tun.h tun: port to internal device factory 2014-09-11 12:50:17 -05:00
nm-device-veth.c veth: port to internal device factory 2014-09-11 12:50:16 -05:00
nm-device-veth.h veth: port to internal device factory 2014-09-11 12:50:16 -05:00
nm-device-vlan.c device: Deal with links that vanish during initialization 2014-12-02 11:44:49 +01:00
nm-device-vlan.h vlan: export parent device for VLANs as D-Bus property 2014-11-24 10:33:13 +01:00
nm-device-vxlan.c vxlan: port to internal device factory 2014-09-11 12:50:16 -05:00
nm-device-vxlan.h vxlan: port to internal device factory 2014-09-11 12:50:16 -05:00
nm-device.c core: fix re-activation of connections on EXTERNAL_DOWN interfaces (bgo #741742) 2014-12-19 11:04:46 -06:00
nm-device.h core: don't manage externally created software devices until IFF_UP (rh #1030947) (bgo #725647) 2014-12-16 16:07:49 -06:00