Re: [PATCH] Add no_addrs field in srp_addr structure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Steven Dake napsal(a):
On 03/20/2012 07:35 AM, Jan Friesse wrote:
This should allow us future change to dynamic number of rings without
breaking wire compatibility.

Signed-off-by: Jan Friesse <jfriesse@xxxxxxxxxx>
---
 exec/totemsrp.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/exec/totemsrp.c b/exec/totemsrp.c
index c262d98..dc93cc2 100644
--- a/exec/totemsrp.c
+++ b/exec/totemsrp.c
@@ -153,6 +153,7 @@ enum encapsulation_type {
  * New membership algorithm local variables
  */
 struct srp_addr {
+	uint8_t no_addrs;
 	struct totem_ip_address addr[INTERFACE_MAX];
 };
@@ -677,6 +678,8 @@ static void totemsrp_instance_initialize (struct totemsrp_instance *instance)
 	instance->orf_token_discard = 0;
instance->commit_token = (struct memb_commit_token *)instance->commit_token_storage;
+
+	instance->my_id.no_addrs = INTERFACE_MAX;
 }
static void main_token_seqid_get (

Did you test that all received messages that use the srp_addr struct
have no_addrs set to 2?  If so, then


Thanks for notice. Previous patch correctly set no_addrs for my_id, but it was not copied in outgoing packets. Attached is better patch, which solves this problem (as can be seen in memb_set_print) (better patch pushed to master).

Honza

Reviewed-by: Steven Dake <sdake@xxxxxxxxxx>

Regards
-steve

>From 9a6e9cdb0204e8e395a7e7580647bb84f99e850f Mon Sep 17 00:00:00 2001
From: Jan Friesse <jfriesse@xxxxxxxxxx>
Date: Tue, 20 Mar 2012 13:52:43 +0100
Subject: [PATCH] Add no_addrs field in srp_addr structure

This should allow us future change to dynamic number of rings without
breaking wire compatibility.

Signed-off-by: Jan Friesse <jfriesse@xxxxxxxxxx>
---
 exec/totemsrp.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/exec/totemsrp.c b/exec/totemsrp.c
index c262d98..52ee574 100644
--- a/exec/totemsrp.c
+++ b/exec/totemsrp.c
@@ -153,6 +153,7 @@ enum encapsulation_type {
  * New membership algorithm local variables
  */
 struct srp_addr {
+	uint8_t no_addrs;
 	struct totem_ip_address addr[INTERFACE_MAX];
 };
 
@@ -677,6 +678,8 @@ static void totemsrp_instance_initialize (struct totemsrp_instance *instance)
 	instance->orf_token_discard = 0;
 
 	instance->commit_token = (struct memb_commit_token *)instance->commit_token_storage;
+
+	instance->my_id.no_addrs = INTERFACE_MAX;
 }
 
 static void main_token_seqid_get (
@@ -1100,6 +1103,8 @@ static void srp_addr_copy (struct srp_addr *dest, const struct srp_addr *src)
 {
 	unsigned int i;
 
+	dest->no_addrs = src->no_addrs;
+
 	for (i = 0; i < INTERFACE_MAX; i++) {
 		totemip_copy (&dest->addr[i], &src->addr[i]);
 	}
@@ -1375,10 +1380,10 @@ static void memb_set_print (
 	printf ("List '%s' contains %d entries:\n", string, list_entries);
 
 	for (i = 0; i < list_entries; i++) {
-		for (j = 0; j < INTERFACE_MAX; j++) {
-			printf ("Address %d\n", i);
+		printf ("Address %d with %d rings\n", i, list[i].no_addrs);
+		for (j = 0; j < list[i].no_addrs; j++) {
 			printf ("\tiface %d %s\n", j, totemip_print (&list[i].addr[j]));
-			printf ("family %d\n", list[i].addr[j].family);
+			printf ("\tfamily %d\n", list[i].addr[j].family);
 		}
 	}
 }
-- 
1.7.1

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss

[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux