setsockopt(cs->udpFD, IPPROTO_IPV6, IPV6_RECVPKTINFO, &one, sizeof(one));
#endif
}
-#ifdef SO_REUSEPORT
if (std::get<2>(local)) {
+#ifdef SO_REUSEPORT
SSetsockopt(cs->udpFD, SOL_SOCKET, SO_REUSEPORT, 1);
- }
+#else
+ warnlog("SO_REUSEPORT has been configured on local address '%s' but is not supported", std::get<0>(local).toStringWithPort());
#endif
+ }
#ifdef HAVE_EBPF
if (g_defaultBPFFilter) {
#ifdef TCP_DEFER_ACCEPT
SSetsockopt(cs->tcpFD, SOL_TCP,TCP_DEFER_ACCEPT, 1);
#endif
-#ifdef TCP_FASTOPEN
if (std::get<3>(local) > 0) {
+#ifdef TCP_FASTOPEN
SSetsockopt(cs->tcpFD, SOL_TCP, TCP_FASTOPEN, std::get<3>(local));
- }
+#else
+ warnlog("TCP Fast Open has been configured on local address '%s' but is not supported", std::get<0>(local).toStringWithPort());
#endif
+ }
if(cs->local.sin4.sin_family == AF_INET6) {
SSetsockopt(cs->tcpFD, IPPROTO_IPV6, IPV6_V6ONLY, 1);
}
#ifdef SO_REUSEPORT
+ /* no need to warn again if configured but support is not available, we already did for UDP */
if (std::get<2>(local)) {
SSetsockopt(cs->tcpFD, SOL_SOCKET, SO_REUSEPORT, 1);
}
#ifdef TCP_DEFER_ACCEPT
SSetsockopt(cs->tcpFD, SOL_TCP,TCP_DEFER_ACCEPT, 1);
#endif
-#ifdef TCP_FASTOPEN
if (std::get<3>(dcLocal) > 0) {
+#ifdef TCP_FASTOPEN
SSetsockopt(cs->tcpFD, SOL_TCP, TCP_FASTOPEN, std::get<3>(dcLocal));
- }
+#else
+ warnlog("TCP Fast Open has been configured on local address '%s' but is not supported", std::get<0>(dcLocal).toStringWithPort());
#endif
-#ifdef SO_REUSEPORT
+ }
if (std::get<2>(dcLocal)) {
+#ifdef SO_REUSEPORT
SSetsockopt(cs->tcpFD, SOL_SOCKET, SO_REUSEPORT, 1);
- }
+#else
+ warnlog("SO_REUSEPORT has been configured on local address '%s' but is not supported", std::get<0>(dcLocal).toStringWithPort());
#endif
+ }
if(cs->local.sin4.sin_family == AF_INET6) {
SSetsockopt(cs->tcpFD, IPPROTO_IPV6, IPV6_V6ONLY, 1);
}