1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-01 04:58:35 +03:00

ctdb-eventscripts: Fix regression in IP add/delete functions

Commit 176ae6c704528c021fcc34a41878584f43a00119 caused these functions
to exit on failure.  This is incorrect and broke NAT gateway.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Martin Schwenke 2014-03-14 13:14:18 +11:00 committed by Amitay Isaacs
parent ecafbce1b1
commit 058e14cdb0

View File

@ -832,8 +832,10 @@ add_ip_to_iface ()
ip link set "$_iface" up || \
die "Failed to bringup interface $_iface"
ip addr add "$_ip/$_maskbits" brd + dev "$_iface" || \
die "Failed to add $_ip/$_maskbits on dev $_iface"
ip addr add "$_ip/$_maskbits" brd + dev "$_iface" || {
echo "Failed to add $_ip/$_maskbits on dev $_iface"
return 1
}
}
delete_ip_from_iface()
@ -849,8 +851,10 @@ delete_ip_from_iface()
# remembering and re-adding secondaries.
set_proc "sys/net/ipv4/conf/${_iface}/promote_secondaries" 1
ip addr del "$_ip/$_maskbits" dev "$_iface" || \
die "Failed to del $_ip on dev $_iface"
ip addr del "$_ip/$_maskbits" dev "$_iface" || {
echo "Failed to del $_ip on dev $_iface"
return 1
}
}
# If the given IP is hosted then print 2 items: maskbits and iface