eventscripts: Change handling of one-way kills in kill_tcp_connections()
authorMartin Schwenke <martin@meltin.net>
Mon, 29 Apr 2013 20:14:01 +0000 (06:14 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Mon, 6 May 2013 05:45:10 +0000 (15:45 +1000)
This change is a no-op.  However, In a subsequent commit we'll merge
kill_tcp_connections_local_only() with this function.

Signed-off-by: Martin Schwenke <martin@meltin.net>
config/functions

index 39a71310388887699ee29284cc6157f5c079f35e..e90093a70d2fe4ec6b4f438f08f3817f6c03378b 100755 (executable)
@@ -598,14 +598,15 @@ kill_tcp_connections() {
        echo "Killing TCP connection $src $dest"
        ctdb killtcp $src $dest >/dev/null 2>&1 || _failed=1
        _destport="${dest##*:}"
+       __oneway=false
        case $_destport in
          # we only do one-way killtcp for CIFS
-         139|445) : ;;
-         # for all others we do 2-way
-         *) 
-               ctdb killtcp $dest $src >/dev/null 2>&1 || _failed=1
-               ;;
+         139|445) __oneway=true ;;
        esac
+       if ! $__oneway ; then
+           ctdb killtcp $dest $src >/dev/null 2>&1 || _failed=1
+       fi
+
        _killcount=`expr $_killcount + 1`
      done < $connfile
     rm -f $connfile