From 62a86ac9c94d560445215879aef5c18239add7a6 Mon Sep 17 00:00:00 2001 From: Iblis Lin Date: Wed, 23 Nov 2016 23:02:13 +0800 Subject: [PATCH] server: portable option for setsockopt From linux ipv6(7) manual (section `Note`): SOL_IP, SOL_IPV6, SOL_ICMPV6 and other SOL_* socket options are nonportable variants of IPPROTO_*. See also ip(7). Ref: http://man7.org/linux/man-pages/man7/ipv6.7.html --- lib/server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/server.c b/lib/server.c index 7a82c45b..49f075c3 100644 --- a/lib/server.c +++ b/lib/server.c @@ -110,7 +110,7 @@ lws_context_init_server(struct lws_context_creation_info *info, if (LWS_IPV6_ENABLED(vhost)) { if (vhost->options & LWS_SERVER_OPTION_IPV6_V6ONLY_MODIFY) { int value = (vhost->options & LWS_SERVER_OPTION_IPV6_V6ONLY_VALUE) ? 1 : 0; - if (setsockopt(sockfd, SOL_IPV6, IPV6_V6ONLY, + if (setsockopt(sockfd, IPPROTO_IPV6, IPV6_V6ONLY, (const void*)&value, sizeof(value)) < 0) { compatible_close(sockfd); return 1;