]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-scripts: Don't list connections when not hosting IPs
authorMartin Schwenke <mschwenke@ddn.com>
Thu, 19 Sep 2024 03:52:48 +0000 (13:52 +1000)
committerMartin Schwenke <martins@samba.org>
Wed, 6 Nov 2024 23:03:42 +0000 (23:03 +0000)
With an empty IP filter, all incoming connections to port 2049 will be
listed, not just those to public IP addresses.  This causes error
messages like the following to be logged:

  ctdb-eventd[...]: 60.nfs: Failed to add 1 tickles

since the connection being added seems to be for a random NFS mount
that doesn't use a public IP addresses.

This has been a problem for a long time (probably since commit
04fe9e20749985c71fef1bce7f6e4c439fe11c81 in 2015).  It isn't currently
a huge deal because it only affects NFS connections.  However, this
code will soon be used to track connections to public IP addresses on
all ports.  This would result in a constant stream of log messages,
since there will always be some active connections.

The theory behind the fix is that if a node hosts no public IPs then
it should have no relevant connections and has no business changing
the list of registered tickles.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
ctdb/config/functions

index f8f539ad53f76473bfe7d120038741521016b568..bff96303020cb3db79d197c845b11b4848b39e6e 100755 (executable)
@@ -1189,6 +1189,10 @@ update_tickles()
        # What public IPs do I hold?
        _pnn=$(ctdb_get_pnn)
        _ips=$($CTDB -X ip | awk -F'|' -v pnn="$_pnn" '$3 == pnn {print $2}')
+       # If not hosting any public IPs then can't have any connections...
+       if [ -z "$_ips" ]; then
+               return
+       fi
 
        # IPs and port as ss filters
        _ip_filter=""