Skip to contentSkip to conversation

cman: fix ttl default if no value is specified

PATCH New Fabio M. Di Nitto 2 participants 2 messages Jun 20, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cman: fix ttl default if no value is specified

when specifing a multicast address, ttl was set to 0 unless ttl was explicitly set in cluster.conf.

Resolves: rhbz#713977

---
 cman/daemon/cman-preconfig.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
cman/daemon/cman-preconfig.c +1 -1
index a890fb3..aeedf8b 100644
@@ -673,7 +673,7 @@ static int get_nodename(struct objdb_iface_ver0 *objdb)
 			if (objdb->object_find_next(find_handle2, &mcast_handle) == 0) {
 
 				objdb_get_string(objdb, mcast_handle, "addr", &mcast_name);
-				objdb_get_int(objdb, mcast_handle, "ttl", &ttl, 0);
+				objdb_get_int(objdb, mcast_handle, "ttl", &ttl, ttl);
 			}
 			objdb->object_find_destroy(find_handle2);
 		}
Signature · 1 line
1.7.4.4
#1 lore raw

PATCH 1/1 cman: fix ttl default if no value is specified

Quoted 2 lines · Fabio M. Di Nitto

when specifing a multicast address, ttl was set to 0 unless ttl was explicitly set in cluster.conf.

I reviewed this; this patch looks correct, based on function and also this comment / code on lines 360-361:

    /* add the key to the objdb only if value is not default */
    if (ttl != 1) {

... as well as understanding the objdb_get_int() function.

ACK.

-- Lon

Quoted 25 lines

Resolves: rhbz#713977

---
 cman/daemon/cman-preconfig.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
cman/daemon/cman-preconfig.c +1 -1
index a890fb3..aeedf8b 100644
@@ -673,7 +673,7 @@ static int get_nodename(struct objdb_iface_ver0 *objdb)
 			if (objdb->object_find_next(find_handle2, &mcast_handle) == 0) {
 
 				objdb_get_string(objdb, mcast_handle, "addr", &mcast_name);
-				objdb_get_int(objdb, mcast_handle, "ttl", &ttl, 0);
+				objdb_get_int(objdb, mcast_handle, "ttl", &ttl, ttl);
 			}
 			objdb->object_find_destroy(find_handle2);
 		}
Signature · 1 line
1.7.4.4
Signature · 1 line
Lon Hohberger - Red Hat, Inc.