NetworkManager/src
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
..
devices core: fix re-activation of connections on EXTERNAL_DOWN interfaces (bgo #741742) 2014-12-19 11:04:46 -06:00
dhcp-manager all: move STRLEN() macro to global header nm-utils-internal.h 2014-12-18 17:36:57 +01:00
dns-manager all: consistently include config.h 2014-11-13 17:18:42 -05:00
dnsmasq-manager all: consistently include config.h 2014-11-13 17:18:42 -05:00
platform platform/tests: for route tests, add test routes with a different metric 2014-12-16 23:55:02 +01:00
ppp-manager all: consistently include config.h 2014-11-13 17:18:42 -05:00
rdisc all: consistently include config.h 2014-11-13 17:18:42 -05:00
settings ifcfg-rh/tests: remove unused variable 2014-12-18 19:03:06 +01:00
supplicant-manager all: consistently include config.h 2014-11-13 17:18:42 -05:00
tests tests: fix NEGATIVE_RETURNS (CWE-394) in tests 2014-12-15 16:25:27 +01:00
vpn-manager core: adjust values for default route-metrics per device type 2014-11-26 20:39:18 +01:00
main-utils.c libnm: remove nm_utils_init() from the public API 2014-12-04 08:39:54 -05:00
main-utils.h core: split signal/pidfile/option handling into separate source file 2014-11-07 12:18:32 -06:00
main.c libnm-core: add _nm_utils_is_manager_process 2014-11-15 09:48:42 -05:00
Makefile.am dhcp: re-fix system-dhcp code after re-import 2014-11-19 12:02:12 -05:00
NetworkManagerUtils.c utils: add missing va_end macro in nm_utils_uuid_generate_from_strings() 2014-12-12 16:22:57 +01:00
NetworkManagerUtils.h all: move STRLEN() macro to global header nm-utils-internal.h 2014-12-18 17:36:57 +01:00
nm-activation-request.c all: remove a bunch of unnecessary dbus/dbus-glib includes 2014-09-03 10:45:24 -04:00
nm-activation-request.h all: fix up multiple-include-guard defines 2014-08-16 10:17:14 -04:00
nm-active-connection.c all: consistently include config.h 2014-11-13 17:18:42 -05:00
nm-active-connection.h vpn/core: move VPN gateway route between devices when routing changes 2014-11-06 21:17:34 -06:00
nm-auth-manager.c all: consistently include config.h 2014-11-13 17:18:42 -05:00
nm-auth-manager.h core: drop all remaining core-internal error domains 2014-10-22 08:29:10 -04:00
nm-auth-subject.c all: consistently include config.h 2014-11-13 17:18:42 -05:00
nm-auth-subject.h auth: support disabling POLKIT authentication entirely at compile time 2014-09-29 13:51:11 +02:00
nm-auth-utils.c all: consistently include config.h 2014-11-13 17:18:42 -05:00
nm-auth-utils.h auth: rework polkit autorization to use DBUS interface directly 2014-09-29 13:51:11 +02:00
nm-config.c all: consistently include config.h 2014-11-13 17:18:42 -05:00
nm-config.h core: add option to quit when startup is complete (rh #863515) (rh #1083683) 2014-11-07 12:18:33 -06:00
nm-connection-provider.c all: consistently include config.h 2014-11-13 17:18:42 -05:00
nm-connection-provider.h all: fix up multiple-include-guard defines 2014-08-16 10:17:14 -04:00
nm-connectivity.c all: consistently include config.h 2014-11-13 17:18:42 -05:00
nm-connectivity.h all: fix up multiple-include-guard defines 2014-08-16 10:17:14 -04:00
nm-dbus-manager.c all: consistently include config.h 2014-11-13 17:18:42 -05:00
nm-dbus-manager.h core: fill in nm-types.h, clean out other headers 2014-07-23 10:56:26 -04:00
nm-dcb.c all: consistently include config.h 2014-11-13 17:18:42 -05:00
nm-dcb.h core: drop all remaining core-internal error domains 2014-10-22 08:29:10 -04:00
nm-default-route-manager.c platform: add paramter to ip4_route_add to set src (RTA_PREFSRC) 2014-11-25 22:30:38 +01:00
nm-default-route-manager.h policy: remove redundant remove_default_route() functions from NMDefaultRouteManager 2014-11-19 22:55:32 +01:00
nm-dhcp4-config.c all: consistently include config.h 2014-11-13 17:18:42 -05:00
nm-dhcp4-config.h all: fix up multiple-include-guard defines 2014-08-16 10:17:14 -04:00
nm-dhcp6-config.c all: consistently include config.h 2014-11-13 17:18:42 -05:00
nm-dhcp6-config.h all: fix up multiple-include-guard defines 2014-08-16 10:17:14 -04:00
nm-dispatcher.c all: consistently include config.h 2014-11-13 17:18:42 -05:00
nm-dispatcher.h all: fix up multiple-include-guard defines 2014-08-16 10:17:14 -04:00
nm-firewall-manager.c firewall: always complete callbacks asynchronously 2014-11-19 12:59:42 +01:00
nm-firewall-manager.h firewall: make call handle an opaque pointer type 2014-11-19 12:58:36 +01:00
nm-iface-helper.c iface-helper: disambiguate route priority for IPv4 and IPv6 2014-12-01 16:58:31 +01:00
nm-ip4-config.c core: fix route metrics for subnet routes 2014-11-25 22:30:38 +01:00
nm-ip4-config.h core: fix route metrics for subnet routes 2014-11-25 22:30:38 +01:00
nm-ip6-config.c libnm: allow zero prefix length for NMIPRoute 2014-11-24 18:02:46 +01:00
nm-ip6-config.h core: add nm_ip4_config_get_subnet_for_host() function 2014-11-07 15:23:11 +01:00
nm-logging.c logging: pass file:line as separate arguments to _nm_log() 2014-12-18 17:36:57 +01:00
nm-logging.h logging: pass file:line as separate arguments to _nm_log() 2014-12-18 17:36:57 +01:00
nm-manager.c core: don't assume connection if device is EXTERNAL_DOWN (bgo #741694) 2014-12-18 11:11:10 -06:00
nm-manager.h iface-helper: add nm-iface-helper for dynamic configure-then-quit support 2014-11-07 12:18:33 -06:00
nm-policy.c firewall: don't set firewall zone for assumed devices 2014-11-19 12:59:42 +01:00
nm-policy.h all: fix up multiple-include-guard defines 2014-08-16 10:17:14 -04:00
nm-posix-signals.c core: merge src/config, src/logging, src/posix-signals into src/ 2014-07-30 15:56:29 -04:00
nm-posix-signals.h all: fix up multiple-include-guard defines 2014-08-16 10:17:14 -04:00
nm-properties-changed-signal.c all: consistently include config.h 2014-11-13 17:18:42 -05:00
nm-properties-changed-signal.h core: make nm-properties-changed-signal always export the right properties 2013-05-20 16:38:33 -03:00
nm-rfkill-manager.c all: consistently include config.h 2014-11-13 17:18:42 -05:00
nm-rfkill-manager.h all: fix up multiple-include-guard defines 2014-08-16 10:17:14 -04:00
nm-session-monitor-ck.c all: consistently include config.h 2014-11-13 17:18:42 -05:00
nm-session-monitor-null.c all: consistently include config.h 2014-11-13 17:18:42 -05:00
nm-session-monitor-systemd.c all: consistently include config.h 2014-11-13 17:18:42 -05:00
nm-session-monitor.h all: fix up multiple-include-guard defines 2014-08-16 10:17:14 -04:00
nm-session-utils.c all: consistently include config.h 2014-11-13 17:18:42 -05:00
nm-session-utils.h core: drop all remaining core-internal error domains 2014-10-22 08:29:10 -04:00
nm-sleep-monitor-systemd.c core: don't auto-launch logind (bgo #741572) 2014-12-16 09:24:56 -06:00
nm-sleep-monitor-upower.c all: consistently include config.h 2014-11-13 17:18:42 -05:00
nm-sleep-monitor.h all: fix up multiple-include-guard defines 2014-08-16 10:17:14 -04:00
nm-types.h policy: add manager for default routes and support multiple default routes 2014-11-07 15:23:12 +01:00
org.freedesktop.NetworkManager.conf dbus: kill at_console usage in permissions (bgo #707983) (rh #979416) 2014-01-23 16:48:19 -06:00