]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_helpers: Ignore link-local IPv4 address while waiting for DHCP
authorJouni Malinen <jouni@qca.qualcomm.com>
Sun, 26 Mar 2017 09:41:36 +0000 (12:41 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 26 Mar 2017 18:13:21 +0000 (21:13 +0300)
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 <jouni@qca.qualcomm.com>
src/common/wpa_helpers.c

index f1594213f97f5c690595c5b91e26f21a1340133d..8e1c09ec5929eded180d5ec18ca555d8f6e4b064 100644 (file)
@@ -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)