[SCM] CTDB repository - branch master updated - ctdb-1.0.114-356-ge9d04c5

Ronnie Sahlberg sahlberg at samba.org
Thu Oct 7 22:56:01 MDT 2010


The branch, master has been updated
       via  e9d04c5f419eaa0338a3beefba32c52be00242a8 (commit)
       via  f7e91ae905cd61249028e15f2cb509ea69f10b9e (commit)
      from  23510bf858c06a3710d1cc741d32bad3675fd97e (commit)

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


- Log -----------------------------------------------------------------
commit e9d04c5f419eaa0338a3beefba32c52be00242a8
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Fri Oct 8 15:51:44 2010 +1100

    Spotted by rusty.
    
    Add a missing $
    so we delete $_ip   and not _ip

commit f7e91ae905cd61249028e15f2cb509ea69f10b9e
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Fri Oct 8 13:14:14 2010 +1100

    change the hash function to use the much better Jenkins hash
    from the tdb library
    
    cq S1020233

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

Summary of changes:
 common/ctdb_util.c       |    9 +--------
 config/events.d/11.natgw |    2 +-
 2 files changed, 2 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/common/ctdb_util.c b/common/ctdb_util.c
index 4acfa3f..749b9c2 100644
--- a/common/ctdb_util.c
+++ b/common/ctdb_util.c
@@ -99,14 +99,7 @@ bool ctdb_same_address(struct ctdb_address *a1, struct ctdb_address *a2)
 */
 uint32_t ctdb_hash(const TDB_DATA *key)
 {
-	uint32_t value;	/* Used to compute the hash value.  */
-	uint32_t i;	/* Used to cycle through random values. */
-
-	/* Set the initial value from the key size. */
-	for (value = 0x238F13AF * key->dsize, i=0; i < key->dsize; i++)
-		value = (value + (key->dptr[i] << (i*5 % 24)));
-
-	return (1103515243 * value + 12345);  
+	return tdb_jenkins_hash(discard_const(key));
 }
 
 /*
diff --git a/config/events.d/11.natgw b/config/events.d/11.natgw
index f8892a9..34aee19 100755
--- a/config/events.d/11.natgw
+++ b/config/events.d/11.natgw
@@ -33,7 +33,7 @@ delete_all() {
 	iptables -D POSTROUTING -t nat -s $CTDB_NATGW_PRIVATE_NETWORK -d ! $CTDB_NATGW_PRIVATE_NETWORK -j MASQUERADE >/dev/null 2>/dev/null
 
 	# remove any iptables rule we may have on this address
-	iptables -D INPUT -p tcp --syn -d _ip/32 -j REJECT 2>/dev/null
+	iptables -D INPUT -p tcp --syn -d $_ip/32 -j REJECT 2>/dev/null
 }
 
 case "$1" in 


-- 
CTDB repository


More information about the samba-cvs mailing list