Open cattyhouse opened 1 year ago
fixed with this patch:
diff --git a/plugin/pkg/reuseport/listen_reuseport.go b/plugin/pkg/reuseport/listen_reuseport.go
index 71fac3e7..6b3ba95a 100644
--- a/plugin/pkg/reuseport/listen_reuseport.go
+++ b/plugin/pkg/reuseport/listen_reuseport.go
@@ -17,6 +17,9 @@ func control(network, address string, c syscall.RawConn) error {
if err := unix.SetsockoptInt(int(fd), unix.SOL_SOCKET, unix.SO_REUSEPORT, 1); err != nil {
log.Warningf("Failed to set SO_REUSEPORT on socket: %s", err)
}
+ if err := unix.SetsockoptInt(int(fd), unix.SOL_SOCKET, unix.SO_REUSEADDR, 1); err != nil {
+ log.Warningf("Failed to set SO_REUSEADDR on socket: %s", err)
+ }
})
return nil
}
similar functions in adguard/dnsproxy
the strange part is, with coredns, the unix.SO_REUSEPORT
also set SO_REUSEADDR
for TCP, so if the above patch applied, SO_REUSEADDR
gets set twice for TCP, but that's not a big problem
@chrisohaver any comment prior 1.11.2 release?
I'm not seeing this as a strong need. Perhaps I'm mistaken.
How long have you been using the patched build?
I'm not seeing this as a strong need. Perhaps I'm mistaken.
How long have you been using the patched build?
Since May 3 , 2023
strace coredns shows that:
is this by design? this would block
linux tproxy
from working when:failed to dial tproxy udp | dial: socket bind: address already in use
if i need
UDP SO_REUSEADDR
, what modification do i need to make to get it working?strace coredns: