From fb1979c0ea821f4895240e38676e77075ed53525 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Thu, 11 Apr 2019 21:26:29 +0100 Subject: [PATCH] Fix build on SmartOS due to missing IPV6_V6ONLY. Thanks to Matt Ingenthron. Closes #1212. --- ChangeLog.txt | 3 +++ src/net.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index ca4d1c55..f58a4903 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -47,6 +47,9 @@ Client features: - Add explicit support for TLS v1.3. - Drop support for TLS v1.0. +Broker fixes: +- Fix build on SmartOS due to missing IPV6_V6ONLY. Closes #1212. + Client fixes: - mosquitto_pub wouldn't always publish all messages when using `-l` and QoS>0. This has been fixed. diff --git a/src/net.c b/src/net.c index 6d72b503..7b6793cb 100644 --- a/src/net.c +++ b/src/net.c @@ -470,8 +470,10 @@ int net__socket_listen(struct mosquitto__listener *listener) ss_opt = 1; setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &ss_opt, sizeof(ss_opt)); #endif +#ifdef IPV6_V6ONLY ss_opt = 1; setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, &ss_opt, sizeof(ss_opt)); +#endif if(net__socket_nonblock(&sock)){ return 1;