diff options
author | Jiří Klimeš <jklimes@redhat.com> | 2014-04-15 11:51:56 +0200 |
---|---|---|
committer | Jiří Klimeš <jklimes@redhat.com> | 2014-04-15 12:55:33 +0200 |
commit | c54faa4801e5c5155a4a9fb0ed6078d13dc57df6 (patch) | |
tree | 6b7d843d110fc1c95c2b588953df86cab2e12752 /src/nm-policy.c | |
parent | 7955806a02db64b20079267743056d7d9d45af3b (diff) | |
download | NetworkManager-c54faa4801e5c5155a4a9fb0ed6078d13dc57df6.tar.gz |
policy: check device state before changing it for secondaries (rh #1055099)
We have to check the previous base device state in process_secondaries() when
making a state change. The device might got disconnected in the meantime and
thus the transition from DISCONNECTED to ACTIVATED or FAILED would have been
incorrect.
Logs showing the problem:
NetworkManager[2655]: <info> (eth0): disconnecting for new activation request.
NetworkManager[2655]: <info> (eth0): device state change: secondaries -> deactivating (reason 'none') [90 110 0]
NetworkManager[2655]: <info> (eth0): device state change: deactivating -> disconnected (reason 'none') [110 30 0]
NetworkManager[2655]: <info> (eth0): deactivating device (reason 'none') [0]
NetworkManager[2655]: <info> (eth0): canceled DHCP transaction, DHCP client pid 11409
NetworkManager[2655]: <info> NetworkManager state is now DISCONNECTED
NetworkManager[2655]: (devices/nm-device.c:6591):nm_device_state_changed: runtime check failed: (priv->in_state_changed == FALSE)
NetworkManager[2655]: <info> (eth0): device state change: disconnected -> failed (reason 'secondary-connection-failed') [30 120 54]
NetworkManager[2655]: <warn> Activation (eth0) failed for connection '<unknown>'
NetworkManager[2655]: <warn> (eth0): add_pending_action (4): 'queued state change to disconnected' already added
NetworkManager[2655]: file devices/nm-device.c: line 7682 (nm_device_add_pending_action): should not be reached
NetworkManager[2655]: <info> Activation (eth0) starting connection 'ethernet-12'
NetworkManager[2655]: <info> Activation (eth0) Stage 1 of 5 (Device Prepare) scheduled...
NetworkManager[2655]: <info> (eth0): device state change: failed -> disconnected (reason 'none') [120 30 0]
NetworkManager[2655]: <info> (eth0): deactivating device (reason 'none') [0]
NetworkManager[2655]: <warn> (eth0): remove_pending_action (2): 'queued state change to disconnected' never added
NetworkManager[2655]: file devices/nm-device.c: line 7733 (nm_device_remove_pending_action): should not be reached
NetworkManager[2655]: <info> VPN service 'openvpn' disappeared
https://bugzilla.redhat.com/show_bug.cgi?id=1055099
https://bugzilla.redhat.com/show_bug.cgi?id=1055101
Diffstat (limited to 'src/nm-policy.c')
-rw-r--r-- | src/nm-policy.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/nm-policy.c b/src/nm-policy.c index f454d90fbf..380f4ced47 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -1087,7 +1087,8 @@ process_secondaries (NMPolicy *policy, /* No secondary UUID remained -> remove the secondary data item */ priv->pending_secondaries = g_slist_remove (priv->pending_secondaries, secondary_data); pending_secondary_data_free (secondary_data); - nm_device_state_changed (item_device, NM_DEVICE_STATE_ACTIVATED, NM_DEVICE_STATE_REASON_NONE); + if (nm_device_get_state (item_device) == NM_DEVICE_STATE_SECONDARIES) + nm_device_state_changed (item_device, NM_DEVICE_STATE_ACTIVATED, NM_DEVICE_STATE_REASON_NONE); break; } } else { @@ -1098,8 +1099,10 @@ process_secondaries (NMPolicy *policy, /* Secondary connection failed -> do not watch other connections */ priv->pending_secondaries = g_slist_remove (priv->pending_secondaries, secondary_data); pending_secondary_data_free (secondary_data); - nm_device_state_changed (item_device, NM_DEVICE_STATE_FAILED, - NM_DEVICE_STATE_REASON_SECONDARY_CONNECTION_FAILED); + if ( nm_device_get_state (item_device) == NM_DEVICE_STATE_SECONDARIES + || nm_device_get_state (item_device) == NM_DEVICE_STATE_ACTIVATED) + nm_device_state_changed (item_device, NM_DEVICE_STATE_FAILED, + NM_DEVICE_STATE_REASON_SECONDARY_CONNECTION_FAILED); break; } } |