From: Martin Schwenke Date: Fri, 11 Mar 2016 04:27:10 +0000 (+1100) Subject: ctdb-scripts: Add interface argument to kill_tcp_connections() X-Git-Tag: tdb-1.3.9~45 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b417d7993016c11cff1c9c1aa88ac32d6db4345d;p=thirdparty%2Fsamba.git ctdb-scripts: Add interface argument to kill_tcp_connections() This will be needed for a rewrite of the connection killing code but it is not used yet. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/config/events.d/10.interface b/ctdb/config/events.d/10.interface index 4fb352454b0..f65dd5ea739 100755 --- a/ctdb/config/events.d/10.interface +++ b/ctdb/config/events.d/10.interface @@ -161,7 +161,7 @@ case "$1" in # we do an extra delete to cope with the script being killed iptables_wrapper $family -D INPUT -i $iface -d $ip -j DROP 2> /dev/null iptables_wrapper $family -I INPUT -i $iface -d $ip -j DROP - kill_tcp_connections $ip + kill_tcp_connections "$iface" "$ip" delete_ip_from_iface $iface $ip $maskbits || { iptables_wrapper $family \ diff --git a/ctdb/config/events.d/91.lvs b/ctdb/config/events.d/91.lvs index 47adf33c6d0..57ee2c1a8cb 100755 --- a/ctdb/config/events.d/91.lvs +++ b/ctdb/config/events.d/91.lvs @@ -44,7 +44,8 @@ case "$1" in # kill off any tcp connections ipvsadm -D -t $CTDB_LVS_PUBLIC_IP:0 ipvsadm -D -u $CTDB_LVS_PUBLIC_IP:0 - kill_tcp_connections_local_only $CTDB_LVS_PUBLIC_IP + kill_tcp_connections_local_only \ + "$CTDB_PUBLIC_INTERFACE" "$CTDB_LVS_PUBLIC_IP" ctdb_get_pnn LVSMASTER=`ctdb lvsmaster | sed -e "s/.*Node //" -e "s/ .*//"` diff --git a/ctdb/config/functions b/ctdb/config/functions index 9746895495a..aab7a143529 100755 --- a/ctdb/config/functions +++ b/ctdb/config/functions @@ -430,10 +430,11 @@ ctdb_check_command () ################################################ kill_tcp_connections () { - _ip="$1" + _iface="$1" + _ip="$2" _oneway=false - if [ "$2" = "oneway" ] ; then + if [ "$3" = "oneway" ] ; then _oneway=true fi @@ -494,7 +495,7 @@ kill_tcp_connections () ################################################################## kill_tcp_connections_local_only () { - kill_tcp_connections "$1" "oneway" + kill_tcp_connections "$@" "oneway" } ##################################################################