From a5269dc209a417732fab6e8e36e5602a6f751662 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 26 Mar 2017 12:41:36 +0300 Subject: [PATCH] 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 --- src/common/wpa_helpers.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)