]> git.ipfire.org Git - thirdparty/samba.git/commit
ctdb-tcp: Only attempt to automatically bind to local IPs
authorMartin Schwenke <mschwenke@ddn.com>
Thu, 3 Oct 2024 05:07:40 +0000 (15:07 +1000)
committerAnoop C S <anoopcs@samba.org>
Mon, 7 Oct 2024 15:58:38 +0000 (15:58 +0000)
commit939e5bdfd20b4029cc90d7d378319b26ed454dcc
treef2592c0e9e9d02f52eedaceac88ff0916e762b7e
parent5af2f09a1f30e7ed5a741d8eeee122d44241ddfc
ctdb-tcp: Only attempt to automatically bind to local IPs

Automatic node address selection in the TCP transport does not work if
net.ipv4.ip_nonlocal_bind=1 because all nodes will be able to bind()
to the first address in the nodes list.

Before getting to the bind() step, add a check to see if an address is
local (i.e. on an interface).  If not, it is not considered.

This is defensively coded so that this step is skipped if local
addresses can not be retrieved.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
ctdb/doc/ctdb.conf.5.xml
ctdb/tcp/tcp_connect.c
ctdb/wscript