From 1a56255c54ed0b914f3a80055c85720518fc0cff Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Fri, 21 May 2021 16:13:44 +0200 Subject: [PATCH] [web] Fix for websocket server only listening on ipv6 on FreeBSD Credit @luusl --- src/websocket.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/websocket.c b/src/websocket.c index fd90194b..aac947a8 100644 --- a/src/websocket.c +++ b/src/websocket.c @@ -487,7 +487,9 @@ websocket_init(void) info.port = websocket_port; info.iface = websocket_interface; info.protocols = protocols; - if (!cfg_getbool(cfg_getsec(cfg, "general"), "ipv6")) + if (cfg_getbool(cfg_getsec(cfg, "general"), "ipv6")) + info.options |= LWS_SERVER_OPTION_IPV6_V6ONLY_MODIFY; // Assures dual stack is enabled by switching off IPV6_V6ONLY + else info.options |= LWS_SERVER_OPTION_DISABLE_IPV6; info.gid = -1; info.uid = -1;