[SCM] CTDB repository - branch ipv6-test updated - 6da7b36b7ccc4ee9b809867ea32036f09a801bb3

Ronnie Sahlberg sahlberg at samba.org
Wed Aug 20 01:22:59 GMT 2008


The branch, ipv6-test has been updated
       via  6da7b36b7ccc4ee9b809867ea32036f09a801bb3 (commit)
      from  83735951352a243da185031e4853e7e40c43a0fb (commit)

http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=ipv6-test


- Log -----------------------------------------------------------------
commit 6da7b36b7ccc4ee9b809867ea32036f09a801bb3
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Wed Aug 20 09:47:00 2008 +1000

    update the socketkiller in the eventscripts to be able to handle ipv6

-----------------------------------------------------------------------

Summary of changes:
 config/functions |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/config/functions b/config/functions
index 5df121f..36f0e9e 100644
--- a/config/functions
+++ b/config/functions
@@ -224,11 +224,12 @@ kill_tcp_connections() {
     _killcount=0
     connfile="$CTDB_BASE/state/connections.$_IP"
     netstat -tn |egrep "^tcp.*[[:space:]]+$_IP:.*ESTABLISHED" | awk '{print $4" "$5}' > $connfile
+
     while read dest src; do
-	srcip=`echo $src | cut -d: -f1`
-	srcport=`echo $src | cut -d: -f2`
-	destip=`echo $dest | cut -d: -f1`
-	destport=`echo $dest | cut -d: -f2`
+	srcip=`echo $src | sed -e "s/:[^:]*$//"`
+	srcport=`echo $src | sed -e "s/^.*://"`
+	destip=`echo $dest | sed -e "s/:[^:]*$//"`
+	destport=`echo $dest | sed -e "s/^.*://"`
 	echo "Killing TCP connection $srcip:$srcport $destip:$destport"
 	ctdb killtcp $srcip:$srcport $destip:$destport >/dev/null 2>&1 || _failed=1
 	case $destport in
@@ -240,8 +241,9 @@ kill_tcp_connections() {
 		;;
 	esac
 	_killcount=`expr $_killcount + 1`
-    done < $connfile
+     done < $connfile
     /bin/rm -f $connfile
+
     [ $_failed = 0 ] || {
 	echo "Failed to send killtcp control"
 	return;
@@ -352,3 +354,4 @@ startstop_nfslock() {
 [ -x $CTDB_BASE/rc.local ] && {
 	. $CTDB_BASE/rc.local
 }
+


-- 
CTDB repository


More information about the samba-cvs mailing list