From 80c46372b4c1126df3ec970327a1994888bdd7d1 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 28 Oct 2026 12:07:09 -0400 Subject: [PATCH] MT#55283 update libwebsockets V6ONLY logic 4.3 seems to change the default behaviour regarding dual v4/v6 socket setup with port-only bindings. Change it to be explicit about it: Always request v6-only sockets and open a separate v4 socket. Keep the previous code only for <2.1 versions, which don't know about the required options. Change-Id: I6a437bac601e9de49ced26e993d04cdbf5325796 (cherry picked from commit 64c3bc104e3d1c232186bba3329c29c2d90d30f5) --- daemon/websocket.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/daemon/websocket.c b/daemon/websocket.c index c5e25b061..122b088c9 100644 --- a/daemon/websocket.c +++ b/daemon/websocket.c @@ -1152,6 +1152,7 @@ static void websocket_cleanup(void) { static void addr_any_v6_consolidate(endpoint_t eps[2], bool have_lws_ipv6) { +#if !(LWS_LIBRARY_VERSION_MAJOR >= 3 || (LWS_LIBRARY_VERSION_MAJOR == 2 && LWS_LIBRARY_VERSION_MINOR >= 1)) // Don't try to double bind on ADDR_ANY. If we find ADDR_ANY, bind to the // v6 port and omit the v4 binding (and let libwebsockets handle the 4/6 // translation) unless we find ourselves without v6 support. @@ -1170,6 +1171,7 @@ static void addr_any_v6_consolidate(endpoint_t eps[2], bool have_lws_ipv6) { eps[0] = eps[1]; eps[1].port = 0; +#endif } int websocket_init(void) { @@ -1230,6 +1232,8 @@ int websocket_init(void) { .protocols = websocket_protocols, .keepalive_timeout = rtpe_config.http_keepalive_timeout, #if LWS_LIBRARY_VERSION_MAJOR >= 3 || (LWS_LIBRARY_VERSION_MAJOR == 2 && LWS_LIBRARY_VERSION_MINOR >= 1) + .options = LWS_SERVER_OPTION_IPV6_V6ONLY_MODIFY + | LWS_SERVER_OPTION_IPV6_V6ONLY_VALUE, .pt_serv_buf_size = wci.pt_serv_buf_size, #endif };