From ee7b7f3f057c6d2027ba25337377967b594a66a0 Mon Sep 17 00:00:00 2001 From: Cy Schubert Date: Tue, 9 Jun 2020 05:43:51 +0000 Subject: [PATCH] Post CVE-2020-12695 cleanup patch: Resolve a Linuxism to fix the build. MFC after: 3 days X-MFC with: r361957, r361958, r361959 --- contrib/wpa/src/wps/wps_upnp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/wpa/src/wps/wps_upnp.c b/contrib/wpa/src/wps/wps_upnp.c index 93d6fb59a6a9..642ebfc38ca9 100644 --- a/contrib/wpa/src/wps/wps_upnp.c +++ b/contrib/wpa/src/wps/wps_upnp.c @@ -950,7 +950,11 @@ int get_netif_info(const char *net_if, unsigned *ip_addr, char **ip_addr_text, errno, strerror(errno)); goto fail; } +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + addr = (struct sockaddr_in *) &req.ifr_addr; +#else addr = (struct sockaddr_in *) &req.ifr_netmask; +#endif netmask->s_addr = addr->sin_addr.s_addr; }