From: Jouni Malinen Date: Sun, 26 Mar 2017 09:41:36 +0000 (+0300) Subject: wpa_helpers: Ignore link-local IPv4 address while waiting for DHCP X-Git-Tag: hostap_2_7~1426 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5269dc209a417732fab6e8e36e5602a6f751662;p=thirdparty%2Fhostap.git wpa_helpers: Ignore link-local IPv4 address while waiting for DHCP Do not accept a link-local IPv4 address when waiting for a valid DHCP address. This helps with hs20-osu-client use cases where DHCP response has not yet been received. Signed-off-by: Jouni Malinen --- diff --git a/src/common/wpa_helpers.c b/src/common/wpa_helpers.c index f1594213f..8e1c09ec5 100644 --- a/src/common/wpa_helpers.c +++ b/src/common/wpa_helpers.c @@ -222,7 +222,8 @@ int wait_ip_addr(const char *ifname, int timeout) if (get_wpa_status(ifname, "ip_address", ip, sizeof(ip)) == 0 && strlen(ip) > 0) { printf("IP address found: '%s'\n", ip); - return 0; + if (strncmp(ip, "169.254.", 8) != 0) + return 0; } ctrl = wpa_open_ctrl(ifname); if (ctrl == NULL)