From 43f449824a0a3efa61ca70d0bdf5cd82a6b8f796 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 20 Mar 2012 23:21:17 -0500 Subject: [PATCH] mobile: ensure IPv4 timeout fails activation With the switch to IPv4 being allowed to fail by default we need to clean up this old code a bit. PPP failure during IP config should trigger a timeout, and the core code will handle whether to fail the device completely or not. But if we got a valid IPv4 config and PPP failed later, the device gets failed. Previously the device would just sit in IP_CONFIG state because now IPv4 defaults may-fail to TRUE, and when PPP failed the nm_device_ip_config_should_fail() check would obviously not pass. --- src/nm-device-bt.c | 4 +++- src/nm-device-modem.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/nm-device-bt.c b/src/nm-device-bt.c index c3754cddfa..726762b65f 100644 --- a/src/nm-device-bt.c +++ b/src/nm-device-bt.c @@ -437,7 +437,9 @@ ppp_failed (NMModem *modem, NMDeviceStateReason reason, gpointer user_data) case NM_DEVICE_STATE_IP_CHECK: case NM_DEVICE_STATE_SECONDARIES: case NM_DEVICE_STATE_ACTIVATED: - if (nm_device_ip_config_should_fail (device, FALSE)) { + if (nm_device_activate_ip4_state_in_conf (device)) + nm_device_activate_schedule_ip4_config_timeout (device); + else { nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE); diff --git a/src/nm-device-modem.c b/src/nm-device-modem.c index b8280caf11..7f81e98187 100644 --- a/src/nm-device-modem.c +++ b/src/nm-device-modem.c @@ -75,7 +75,9 @@ ppp_failed (NMModem *modem, NMDeviceStateReason reason, gpointer user_data) case NM_DEVICE_STATE_IP_CHECK: case NM_DEVICE_STATE_SECONDARIES: case NM_DEVICE_STATE_ACTIVATED: - if (nm_device_ip_config_should_fail (device, FALSE)) { + if (nm_device_activate_ip4_state_in_conf (device)) + nm_device_activate_schedule_ip4_config_timeout (device); + else { nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE);