summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2019-05-21 14:36:01 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2020-06-30 17:08:56 +0200
commit5423a92b0f7c6a301e2474eaaab293de82e824ce (patch)
tree6f4e1fbcac903d489255e2d3e3c1e351729ddaf4
parentf1af22452de2e29aac80dee1d52087c78c739257 (diff)
downloadNetworkManager-bg/wifi-renew-dhcp-on-roam.tar.gz
wifi: renew dynamic IP configuration after roamingbg/wifi-renew-dhcp-on-roam
There are some APs that require a DHCP transaction before allowing other traffic. This is meant to improve security by preventing the use of static addresses. Currently we don't renew DHCP after roaming to a new AP and this can lead to broken connectivity with APs that implement the check described above. Also, even if unlikely, the new AP could be in a different layer 3 network and so the old address could be no longer valid. Renew dynamic IP configuration after we detect the supplicant decided to roam to a new AP. Note that we only trigger a DHCP client restart; the DHCP client already implements the logic to renew the previous address and fall back to a full request in case of NAK or timeout. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/449
-rw-r--r--src/devices/wifi/nm-device-wifi.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c
index 2d97f9b117..cf849bcdc8 100644
--- a/src/devices/wifi/nm-device-wifi.c
+++ b/src/devices/wifi/nm-device-wifi.c
@@ -2564,6 +2564,15 @@ supplicant_iface_notify_current_bss (NMSupplicantInterface *iface,
new_bssid ?: "(none)",
(new_ssid_s = _nm_utils_ssid_to_string (new_ssid)));
+ if (new_bssid) {
+ /* The new AP could be in a different layer 3 network
+ * and so the old DHCP lease could be no longer valid.
+ * Also, some APs (e.g. Cisco) can be configured to drop
+ * all traffic until DHCP completes. To support such
+ * cases, renew the lease when roaming to a new AP. */
+ nm_device_update_dynamic_ip_setup (NM_DEVICE (self));
+ }
+
set_current_ap (self, new_ap, TRUE);
}
}