Bugzilla – Bug 3582
error: outgoing tcp: connect: Address already in use
Last modified: 2018-03-05 16:46:08 CET
Created attachment 495 [details]
Do not log EADDRINUSE connect errors
Since version 1.6.3 unbound set 'SO_REUSEADDR on outgoing tcp connections to
fix the bind before connect limited tcp connections' (commit
This is probably useful if unbound resolves recursive.
If unbound is using forwarder, it causes failures like this, especially if the
request rate is high:
error: outgoing tcp: connect: Address already in use for XXX.XXX.XXX.XXX
Due to SO_REUSEADDR the operating system (OpenBSD) can reuse same source ports
at bind(). Later if it tries to connect() errors occur if target ip and port
are the same. This happens especially if unbound sends many requests to a few
I propose to ignore the error and retry (see my patch).
But maybe it would be better, to avoid SO_REUSEADDR if we use forwarders?
Thanks & Regards
Patch included! Thank you for the report.
I guess that will help out with the logs.
Best regards, Wouter