Browse Source

Zero out unused totemsrp my_proc_list entries

When making my_proc_list smaller, ensure that the
now non-used entries are zero-ed out. There are some suspect
assert's that assume that there is always 2 entries in the list.
These fail when my_proc_list is reduced to 1 entry (and the
valid [0] entry is the same as the 'unused' [1] entry).

Author: Mark Wutzke <mark.wutzke@alliedtelesis.co.nz>



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1659 fd59a12c-fef9-0310-b244-a6a79926bd2f
Angus Salkeld 17 years ago
parent
commit
b56ce92fab
1 changed files with 9 additions and 0 deletions
  1. 9 0
      exec/totemsrp.c

+ 9 - 0
exec/totemsrp.c

@@ -1665,6 +1665,15 @@ static void memb_state_operational_enter (struct totemsrp_instance *instance)
 	instance->my_last_aru = SEQNO_START_MSG;
 	sq_items_release (&instance->regular_sort_queue, SEQNO_START_MSG - 1);
 
+	/* When making my_proc_list smaller, ensure that the
+	 * now non-used entries are zero-ed out. There are some suspect
+	 * assert's that assume that there is always 2 entries in the list.
+	 * These fail when my_proc_list is reduced to 1 entry (and the
+	 * valid [0] entry is the same as the 'unused' [1] entry).
+	 */
+	memset(instance->my_proc_list, 0,
+		   sizeof (struct srp_addr) * instance->my_proc_list_entries);
+
 	instance->my_proc_list_entries = instance->my_new_memb_entries;
 	memcpy (instance->my_proc_list, instance->my_new_memb_list,
 		sizeof (struct srp_addr) * instance->my_memb_entries);