[web] Fix for websocket server only listening on ipv6 on FreeBSD

Credit @luusl
This commit is contained in:
ejurgensen 2021-05-21 16:13:44 +02:00
parent 5128d9478a
commit 1a56255c54
1 changed files with 3 additions and 1 deletions

View File

@ -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;