diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-12-21 20:18:27 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-12-21 20:18:27 -0800 |
| commit | ec709cc4a126b3938446e58c7cce4c026ede4d02 (patch) | |
| tree | 66c5714b5622d19a089fab309ee1506d29351690 | |
| parent | ebcd44e81326baefa892743a2da28fa3d5aa680d (diff) | |
| download | nng-ec709cc4a126b3938446e58c7cce4c026ede4d02.tar.gz nng-ec709cc4a126b3938446e58c7cce4c026ede4d02.tar.bz2 nng-ec709cc4a126b3938446e58c7cce4c026ede4d02.zip | |
posix IPv6: BSD platforms us netinet6/in6.h
| -rw-r--r-- | src/platform/posix/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | src/platform/posix/posix_resolv_gai.c | 5 | ||||
| -rw-r--r-- | src/platform/posix/posix_sockaddr.c | 5 | ||||
| -rw-r--r-- | src/platform/posix/posix_tcpdial.c | 5 | ||||
| -rw-r--r-- | src/platform/posix/posix_tcplisten.c | 5 | ||||
| -rw-r--r-- | src/platform/posix/posix_udp.c | 5 |
6 files changed, 26 insertions, 0 deletions
diff --git a/src/platform/posix/CMakeLists.txt b/src/platform/posix/CMakeLists.txt index 84390c00..95d9a56a 100644 --- a/src/platform/posix/CMakeLists.txt +++ b/src/platform/posix/CMakeLists.txt @@ -71,6 +71,7 @@ if (NNG_PLATFORM_POSIX) nng_check_sym(atomic_flag_test_and_set stdatomic.h NNG_HAVE_STDATOMIC) nng_check_sym(socketpair sys/socket.h NNG_HAVE_SOCKETPAIR) nng_check_sym(AF_INET6 netinet/in.h NNG_HAVE_INET6) + nng_check_sym(AF_INET6 netinet6/in6.h NNG_HAVE_INET6_BSD) nng_check_sym(timespec_get time.h NNG_HAVE_TIMESPEC_GET) nng_check_sym(getentropy sys/random.h NNG_HAVE_SYS_RANDOM) diff --git a/src/platform/posix/posix_resolv_gai.c b/src/platform/posix/posix_resolv_gai.c index 66d7b35b..4dda0c38 100644 --- a/src/platform/posix/posix_resolv_gai.c +++ b/src/platform/posix/posix_resolv_gai.c @@ -37,8 +37,13 @@ #endif #ifndef NNG_HAVE_INET6 +#ifdef HAVE_NNG_HAVE_INET6_BSD +#define NNG_HAVE_INET6 +#include <netinet6/in6.h> +#else #undef NNG_ENABLE_IPV6 #endif +#endif static nni_mtx resolv_mtx = NNI_MTX_INITIALIZER; static nni_cv resolv_cv = NNI_CV_INITIALIZER(&resolv_mtx); diff --git a/src/platform/posix/posix_sockaddr.c b/src/platform/posix/posix_sockaddr.c index 888aa9d8..1906c78d 100644 --- a/src/platform/posix/posix_sockaddr.c +++ b/src/platform/posix/posix_sockaddr.c @@ -23,8 +23,13 @@ #include <sys/un.h> #ifndef NNG_HAVE_INET6 +#ifdef HAVE_NNG_HAVE_INET6_BSD +#define NNG_HAVE_INET6 +#include <netinet6/in6.h> +#else #undef NNG_ENABLE_IPV6 #endif +#endif size_t nni_posix_nn2sockaddr(void *sa, const nni_sockaddr *na) diff --git a/src/platform/posix/posix_tcpdial.c b/src/platform/posix/posix_tcpdial.c index 8a36bba4..03108344 100644 --- a/src/platform/posix/posix_tcpdial.c +++ b/src/platform/posix/posix_tcpdial.c @@ -24,8 +24,13 @@ #include "posix_tcp.h" #ifndef NNG_HAVE_INET6 +#ifdef HAVE_NNG_HAVE_INET6_BSD +#define NNG_HAVE_INET6 +#include <netinet6/in6.h> +#else #undef NNG_ENABLE_IPV6 #endif +#endif // Dialer stuff. int diff --git a/src/platform/posix/posix_tcplisten.c b/src/platform/posix/posix_tcplisten.c index da2e8050..78e9b253 100644 --- a/src/platform/posix/posix_tcplisten.c +++ b/src/platform/posix/posix_tcplisten.c @@ -28,8 +28,13 @@ #endif #ifndef NNG_HAVE_INET6 +#ifdef HAVE_NNG_HAVE_INET6_BSD +#define NNG_HAVE_INET6 +#include <netinet6/in6.h> +#else #undef NNG_ENABLE_IPV6 #endif +#endif #include "posix_tcp.h" diff --git a/src/platform/posix/posix_udp.c b/src/platform/posix/posix_udp.c index f24940db..ade9e02e 100644 --- a/src/platform/posix/posix_udp.c +++ b/src/platform/posix/posix_udp.c @@ -32,8 +32,13 @@ #endif #ifndef NNG_HAVE_INET6 +#ifdef HAVE_NNG_HAVE_INET6_BSD +#define NNG_HAVE_INET6 +#include <netinet6/in6.h> +#else #undef NNG_ENABLE_IPV6 #endif +#endif // Linux has IPV6_ADD_MEMBERSHIP and IPV6_DROP_MEMBERSHIP #ifndef IPV6_JOIN_GROUP |
