Skip to content

Commit 4454fb3

Browse files
committed
fix: using incomplete struct sockaddr_in
Some platform SDKs don't `#include <netinet/in.h>` in `sys/socket.h`.
1 parent c34bf91 commit 4454fb3

4 files changed

Lines changed: 12 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ endif()
258258
if(NOT WIN32)
259259
check_include_file("net/if_arp.h" HAVE_NET_IF_ARP_H)
260260
check_include_file("netdb.h" HAVE_NETDB_H)
261+
check_include_file("netinet/in.h" HAVE_NETINET_IN_H)
261262
endif()
262263

263264
configure_file(proxyres_config.h.in proxyres_config.h @ONLY NEWLINE_STYLE UNIX)

net_util.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
# include <netdb.h>
1313
#endif
1414

15+
#if HAVE_NETINET_IN_H
16+
# include <netinet/in.h>
17+
#endif
18+
1519
#ifdef _WIN32
1620
# include <winsock2.h>
1721
# include <ws2tcpip.h>

proxyres_config.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@
33

44
// Define to 1 if you have the <netdb.h> header file.
55
#cmakedefine HAVE_NETDB_H 1
6+
7+
// Define to 1 if you have the <netinet/in.h> header file.
8+
#cmakedefine HAVE_NETINET_IN_H 1

wpad_dhcp_posix.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
# include <netdb.h>
1414
#endif
1515

16+
#if HAVE_NETINET_IN_H
17+
# include <netinet/in.h>
18+
#endif
19+
1620
#ifdef _WIN32
1721
# include <winsock2.h>
1822
# include <ws2tcpip.h>

0 commit comments

Comments
 (0)