From e3741ea9f304d92606e65fa8e7721c3b55c20a60 Mon Sep 17 00:00:00 2001 From: Steven Dake Date: Tue, 1 Feb 2005 20:40:07 +0000 Subject: [PATCH] More fixes for defect 204. From Mark Haverkamp: |Looking at the totempg config change function, I think that leaving |members should have their assembly area reset. I assume that any data |that is there is now invalid, and we wouldn't want it hanging around if |they return. Also, I think that the wrong index was being used to |initialize the assembly area index. (Logical change 1.126) git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@443 fd59a12c-fef9-0310-b244-a6a79926bd2f --- exec/totempg.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/exec/totempg.c b/exec/totempg.c index 484b8b70..2f33354b 100644 --- a/exec/totempg.c +++ b/exec/totempg.c @@ -178,6 +178,22 @@ static void totempg_confchg_fn ( int j; int found; + /* + * Clean out the assembly area for nodes that have left the + * membership. If they return, we don't want any stale message + * data that may be there. + */ + for (i = 0; i < left_list_entries; i++) { + for (j = 0; j < assembly_list_entries; j++) { + if (left_list[i].s_addr == assembly_list[j]->addr.s_addr) { + assembly_list[j]->index = 0; + } + } + } + + /* + * Create a message assembly area for any new members. + */ for (i = 0; i < member_list_entries; i++) { found = 0; for (j = 0; j < assembly_list_entries; j++) { @@ -190,8 +206,9 @@ static void totempg_confchg_fn ( assembly_list[assembly_list_entries] = malloc (sizeof (struct assembly)); assert (assembly_list[assembly_list_entries]); // TODO - assembly_list[assembly_list_entries]->addr.s_addr = member_list[i].s_addr; - assembly_list[i]->index = 0; + assembly_list[assembly_list_entries]->addr.s_addr = + member_list[i].s_addr; + assembly_list[assembly_list_entries]->index = 0; assembly_list_entries += 1; } }