Skip to contentSkip to conversation

Honor implicit "ip_family=auto" in fence_xvm w/IPv6 mult.addr.

PATCH New Jan Pokorný 1 participant 2 messages Nov 27, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Honor implicit "ip_family=auto" in fence_xvm w/IPv6 mult.addr.

Previously this wasn't the case:

$ ./fence_xvm -d -a ff05::3:1 -H asdfaf
-- args @ 0x7fff5bc158c0 --
  args->domain = asdfaf
  args->op = 2
  args->net.key_file = /etc/cluster/fence_xvm.key
  args->net.hash = 2
  args->net.addr = ff05::3:1
  args->net.auth = 2
  args->net.port = 1229
  args->net.ifindex = 0
  args->net.family = 2
  args->timeout = 30
  args->retr_time = 20
  args->flags = 0
  args->debug = 1
-- end args --
[...]

args->net.family is being assigned value of PF_INET (2) instead of PF_INET6 (10) as it ought to be with implicit "auto" value as declared, e.g., in metadata:

<parameter name="ip_family">

	<getopt mixed="-i" />
	<content type="string" default="auto" />
	<shortdesc lang="en">IP Family ([auto], ipv4, ipv6)</shortdesc>

</parameter>

After the fix, we get the expected behavior when using IPv6 multicast address:

$ ./fence_xvm -d -a ff05::3:1 -H asdfaf
-- args @ 0x7fff21b5a490 --
  args->domain = asdfaf
  args->op = 2
  args->net.key_file = /etc/cluster/fence_xvm.key
  args->net.hash = 2
  args->net.addr = ff05::3:1
  args->net.auth = 2
  args->net.port = 1229
  args->net.ifindex = 0
  args->net.family = 10
  args->timeout = 30
  args->retr_time = 20
  args->flags = 0
  args->debug = 1
-- end args --
[...]
---
 client/options.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
client/options.c +1 -1
index 6a7772b..dd0bda6 100644
@@ -548,7 +548,7 @@ args_init(fence_virt_args_t *args)
 	args->net.addr = NULL;
 	args->net.port = DEFAULT_MCAST_PORT;
 	args->net.ifindex = 0;
-	args->net.family = PF_INET;
+	args->net.family = 0;  /* auto */
 	args->serial.device = NULL;
 	args->serial.speed = strdup(DEFAULT_SERIAL_SPEED);
 	args->serial.address = strdup(DEFAULT_CHANNEL_IP);
Signature · 1 line
1.7.11.7
#1 lore raw

PATCH 1/1 Honor implicit "ip_family=auto" in fence_xvm w/IPv6 mult.addr.

Previously this wasn't the case:

$ ./fence_xvm -d -a ff05::3:1 -H asdfaf
-- args @ 0x7fffb9575340 --
  args->domain = asdfaf
  args->op = 2
  args->net.key_file = /etc/cluster/fence_xvm.key
  args->net.hash = 2
  args->net.addr = ff05::3:1
  args->net.auth = 2
  args->net.port = 1229
  args->net.ifindex = 0
  args->net.family = 2
  args->timeout = 30
  args->retr_time = 20
  args->flags = 0
  args->debug = 1
-- end args --
[...]

args->net.family is being assigned value of PF_INET (2) instead of PF_INET6 (10) as it ought to be with implicit "auto" value as declared, e.g., in metadata:

<parameter name="ip_family">

	<getopt mixed="-i" />
	<content type="string" default="auto" />
	<shortdesc lang="en">IP Family ([auto], ipv4, ipv6)</shortdesc>

</parameter>

After the fix, we get the expected behavior when using IPv6 multicast address:

$ ./fence_xvm -d -a ff05::3:1 -H asdfaf
-- args @ 0x7fffe4af7120 --
  args->domain = asdfaf
  args->op = 2
  args->net.key_file = /etc/cluster/fence_xvm.key
  args->net.hash = 2
  args->net.addr = ff05::3:1
  args->net.auth = 2
  args->net.port = 1229
  args->net.ifindex = 0
  args->net.family = 10
  args->timeout = 30
  args->retr_time = 20
  args->flags = 0
  args->debug = 1
-- end args --
[...]
---
 client/options.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
client/options.c +1 -1
index 40c6587..27f899d 100644
@@ -582,7 +582,7 @@ args_init(fence_virt_args_t *args)
 	args->net.ipaddr = NULL;
 	args->net.port = DEFAULT_MCAST_PORT;
 	args->net.ifindex = 0;
-	args->net.family = PF_INET;
+	args->net.family = 0;  /* auto */
 	args->serial.device = NULL;
 	args->serial.speed = strdup(DEFAULT_SERIAL_SPEED);
 	args->serial.address = strdup(DEFAULT_CHANNEL_IP);
Signature · 1 line
1.7.11.7