Skip to content

Commit

Permalink
Include netinet6/in6.h (#728)
Browse files Browse the repository at this point in the history
On some platforms, "netinet6/in6.h" is not included by "netinet/in.h"
and needs to be included separately.

Fix By: Faraz (@farazrbx)
  • Loading branch information
farazrbx authored and bradh352 committed Mar 23, 2024
1 parent 63ecd06 commit 0679966
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H)
CHECK_INCLUDE_FILES (memory.h HAVE_MEMORY_H)
CHECK_INCLUDE_FILES (netdb.h HAVE_NETDB_H)
CHECK_INCLUDE_FILES (netinet/in.h HAVE_NETINET_IN_H)
CHECK_INCLUDE_FILES (netinet6/in6.h HAVE_NETINET6_IN6_H)
# On old MacOS SDK versions, you must include sys/socket.h before net/if.h
IF (HAVE_SYS_SOCKET_H)
CHECK_INCLUDE_FILES ("sys/socket.h;net/if.h" HAVE_NET_IF_H)
Expand Down Expand Up @@ -314,6 +315,7 @@ CARES_EXTRAINCLUDE_IFSET (HAVE_NETDB_H netdb.h)
CARES_EXTRAINCLUDE_IFSET (HAVE_NET_IF_H net/if.h)
CARES_EXTRAINCLUDE_IFSET (HAVE_IFADDRS_H ifaddrs.h)
CARES_EXTRAINCLUDE_IFSET (HAVE_NETINET_IN_H netinet/in.h)
CARES_EXTRAINCLUDE_IFSET (HAVE_NETINET6_IN6_H netinet6/in6.h)
CARES_EXTRAINCLUDE_IFSET (HAVE_NETINET_TCP_H netinet/tcp.h)
CARES_EXTRAINCLUDE_IFSET (HAVE_SIGNAL_H signal.h)
CARES_EXTRAINCLUDE_IFSET (HAVE_STDLIB_H stdlib.h)
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ AC_CHECK_HEADERS(
netioapi.h \
netdb.h \
netinet/in.h \
netinet6/in6.h \
netinet/tcp.h \
net/if.h \
ifaddrs.h \
Expand Down
3 changes: 3 additions & 0 deletions src/lib/ares_config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@
/* Define to 1 if you have the <netinet/in.h> header file. */
#cmakedefine HAVE_NETINET_IN_H

/* Define to 1 if you have the <netinet6/in6.h> header file. */
#cmakedefine HAVE_NETINET6_IN6_H

/* Define to 1 if you have the <netinet/tcp.h> header file. */
#cmakedefine HAVE_NETINET_TCP_H

Expand Down
4 changes: 4 additions & 0 deletions src/lib/ares_ipv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
#ifndef ARES_IPV6_H
#define ARES_IPV6_H

#ifdef HAVE_NETINET6_IN6_H
# include <netinet6/in6.h>
#endif

#ifndef HAVE_PF_INET6
# define PF_INET6 AF_INET6
#endif
Expand Down

0 comments on commit 0679966

Please sign in to comment.