Selaa lähdekoodia

totem: fix check if all nodes have same number of links

configured links may not come in order in the interfaces array, which
holds an entry for _all_ possible links, not just configured ones.

So iterate through all interfaces, but skip those which are not
configured. This allows to start corosync with a configuration where
link 0 is currently not mentioned, as else it was checked but had
member_count = 0 from it's default initialization, which then made
this code report a false positive for the "Not all nodes have the
same number of links" check even on a correct config.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Thomas Lamprecht 6 vuotta sitten
vanhempi
commit
816324c94c
1 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  1. 4 1
      exec/totemconfig.c

+ 4 - 1
exec/totemconfig.c

@@ -467,7 +467,10 @@ static int totem_volatile_config_validate (
 			}
 		}
 
-		for (i=0; i<num_configured; i++) {
+		for (i=0; i < INTERFACE_MAX; i++) {
+			if (!totem_config->interfaces[i].configured) {
+				continue;
+			}
 			if (totem_config->interfaces[i].member_count != members) {
 				snprintf (local_error_reason, sizeof(local_error_reason),
 					  "Not all nodes have the same number of links");