]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS UPnP: Fix FreeBSD build
authorJouni Malinen <jouni@codeaurora.org>
Tue, 9 Jun 2020 09:43:53 +0000 (12:43 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 9 Jun 2020 09:43:53 +0000 (12:43 +0300)
struct ifreq does not include the ifr_netmask alternative on FreeBSD, so
replace that more specific name with ifr_addr that works with both Linux
and FreeBSD.

Fixes: 5b78c8f961f2 ("WPS UPnP: Do not allow event subscriptions with URLs to other networks")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/wps/wps_upnp.c

index ab685d52ecab08754bd86c4ea2118e4c9fb9a36f..16fefc77be24f5e384feb060e63f53f0ba746856 100644 (file)
@@ -951,7 +951,7 @@ int get_netif_info(const char *net_if, unsigned *ip_addr, char **ip_addr_text,
                                   errno, strerror(errno));
                        goto fail;
                }
-               addr = (struct sockaddr_in *) &req.ifr_netmask;
+               addr = (struct sockaddr_in *) &req.ifr_addr;
                netmask->s_addr = addr->sin_addr.s_addr;
        }