]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-scripts: Add address with specified mask bits in updateip
authorMartin Schwenke <mschwenke@ddn.com>
Thu, 9 Apr 2026 02:08:40 +0000 (12:08 +1000)
committerMartin Schwenke <martins@samba.org>
Thu, 16 Apr 2026 23:09:33 +0000 (23:09 +0000)
That is, add using $_maskbits, not $maskbits.

In the rare case where the mask bits were inconsistent on the old
interface, $maskbits will be needed for removal from the old
interface.

However, the specified mask bits ($_maskbits) must always be used when
adding to the new interface.  Circumstances where this matters are
likely to be very rare.

It matters more if the address is unexpectedly not assigned at all.
In this case $maskbits will not be set, so the address can't be added
to the new interface using that variable.

This got confused in commit 6471541d6d2bc9f2af0ff92b280abbd1d933cf88.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
ctdb/config/events/legacy/10.interface.script

index 5f947305741d1b33a1e24a9207acc0c4cbe8d6c4..4c1371176fdc22d0a5ba8a693b5cf8b581cdaafe 100755 (executable)
@@ -228,7 +228,7 @@ updateip)
        fi
        delete_ip_from_iface "$niface" "$ip" "$maskbits" >/dev/null 2>&1
 
-       if ! add_ip_to_iface "$niface" "$ip" "$maskbits"; then
+       if ! add_ip_to_iface "$niface" "$ip" "$_maskbits"; then
                ip_unblock "$ip" "$oiface"
                exit 1
        fi