]> git.ipfire.org Git - thirdparty/pdns.git/commit
dnsdist: Use `IP_BIND_ADDRESS_NO_PORT` when available 4786/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 2 Dec 2016 18:12:48 +0000 (19:12 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 19 Dec 2016 10:08:11 +0000 (11:08 +0100)
commitead60f8329b39068d99b5ac3028c031a95c10e9a
tree7fbf7ee343b2cc3238fa5edc73de94cdbdb7ae69
parente0c49e64b206342ad619ecbb9d5e2701d874ebc0
dnsdist: Use `IP_BIND_ADDRESS_NO_PORT` when available

Since Linux 4.2, we can use `IP_BIND_ADDRESS_NO_PORT` to let the kernel
know that we are calling `bind()` only to select the source address
without any intention to listen on the socket. That way the source
port "will be automatically chosen at `connect()` time, in a way
that allows sharing a source port as long as the 4-tuples are unique."

Suggested by Willy Tarreau (thanks!).
pdns/dnsdist-tcp.cc