The "ipv6only" setsockopt logic introduced by 8832c6c4cf was inverted, fix. Also add a msg() to show what value is set, as that makes strange v4/v6 connectivity problems much easier to spot.
Signed-off-by: Gert Doering <g...@greenie.muc.de> --- src/openvpn/socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c index 141af72..100eedd 100644 --- a/src/openvpn/socket.c +++ b/src/openvpn/socket.c @@ -908,8 +908,9 @@ socket_bind (socket_descriptor_t sd, if (ai_family == AF_INET6) { - int v6only = ipv6only ? 0: 1; /* setsockopt must have an "int" */ + int v6only = ipv6only ? 1: 0; /* setsockopt must have an "int" */ + msg (M_INFO, "setsockopt(IPV6_V6ONLY=%d)", v6only); if (setsockopt(sd, IPPROTO_IPV6, IPV6_V6ONLY, &v6only, sizeof(v6only))) { msg (M_NONFATAL|M_ERRNO, "Setting IPV6_V6ONLY=%d failed", v6only); -- 1.8.1.5