diff --git a/src/TNetwork.cpp b/src/TNetwork.cpp index a7d76ed..e733ed6 100644 --- a/src/TNetwork.cpp +++ b/src/TNetwork.cpp @@ -174,6 +174,10 @@ void TNetwork::TCPServerMain() { if (ec) { beammp_warnf("Failed to unset IP_V6ONLY on TCP, only IPv6 will work: {}", ec.message()); } +#if defined(BEAMMP_FREEBSD) + beammp_warnf("WARNING: On FreeBSD, for IPv4 to work, you must run `sysctl net.inet6.ip6.v6only=0`!"); + beammp_debugf("This is due to an annoying detail in the *BSDs: In the name of security, unsetting the IPV6_V6ONLY option does not work by default (but does not fail???), as it allows IPv4 mapped IPv6 like ::ffff:127.0.0.1, which they deem a security issue."); +#endif socket_base::linger LingerOpt {}; LingerOpt.enabled(false); Listener.set_option(LingerOpt, ec);