mirror of
https://github.com/samba-team/samba.git
synced 2025-03-26 18:50:30 +03:00
Revert "Eventscripts - add facility to 10.interface to delete unmanaged IPs"
This reverts commit 88f88d86b0d08240f749fb721b8c401c2eeb1099. This is dangerous and, on reflection, I can't see it being useful. There are often permanent IPs on interfaces that CTDB shares with its public IPs. (This used to be ctdb commit 16aba4eb620844626a1c71c58b51658caf44dea6)
This commit is contained in:
parent
34a6c07e99
commit
66d0aba85b
@ -49,39 +49,10 @@ get_all_interfaces ()
|
||||
all_interfaces=$(echo $all_interfaces $ctdb_ifaces | tr ' ' '\n' | sort -u)
|
||||
}
|
||||
|
||||
delete_unexpected_ips ()
|
||||
{
|
||||
[ "$CTDB_DELETE_UNEXPECTED_IPS" = "yes" ] || return
|
||||
|
||||
for _i in $all_interfaces ; do
|
||||
# Get the IPs actually on this interface
|
||||
_ips=$(ip addr show dev "$_i" | \
|
||||
sed -n -e 's@.*inet[[:space:]]*\([^[:space:]]*\).*scope global.*@\1@p')
|
||||
for _ip in $_ips ; do
|
||||
|
||||
# The NATGW address is OK
|
||||
if [ "$CTDB_NATGW_PUBLIC_IP" = "$_ip" -a \
|
||||
"$CTDB_NATGW_PUBLIC_IFACE" = "$_i" ] ; then
|
||||
continue
|
||||
fi
|
||||
|
||||
# If CTDB knows about the address then it is OK
|
||||
if ctdb ipinfo "${_ip%/*}" >/dev/null 2>&1 ; then
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "WARNING: Removing unmanaged IP address $_ip from interface $_i"
|
||||
delete_ip_from_iface "$_i" "${_ip%/*}" "${_ip#*/}"
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
monitor_interfaces()
|
||||
{
|
||||
get_all_interfaces
|
||||
|
||||
delete_unexpected_ips
|
||||
|
||||
fail=false
|
||||
up_interfaces_found=false
|
||||
|
||||
|
@ -1,22 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. "${TEST_SCRIPTS_DIR}/unit.sh"
|
||||
|
||||
define_test "spurious addresses on interface, delete them"
|
||||
|
||||
setup_ctdb
|
||||
|
||||
iface=$(ctdb_get_1_interface)
|
||||
|
||||
ip addr add 192.168.253.253/24 dev $iface
|
||||
ip addr add 192.168.254.254/24 dev $iface
|
||||
|
||||
export CTDB_DELETE_UNEXPECTED_IPS="yes"
|
||||
|
||||
ok <<EOF
|
||||
WARNING: Removing unmanaged IP address 192.168.253.253/24 from interface dev123
|
||||
Re-adding secondary address 192.168.254.254/24 to dev dev123
|
||||
WARNING: Removing unmanaged IP address 192.168.254.254/24 from interface dev123
|
||||
EOF
|
||||
|
||||
simple_test
|
Loading…
x
Reference in New Issue
Block a user