فهرست منبع

config: if local node addr is wrong, fail with a sensible message

If no valid local address is found in corosync.conf then corosync
exits with: "parse error in config: No multicast port specified"

This is because of the config change for knet that always populates
the interfaces. The old error of "no interfaces found" was only
slightly better anyway IMHO.

This patch adds an explicit check that local_node_pos has been
set in icmap and uses that to determine if a valid local address
has been found.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Christine Caulfield 8 سال پیش
والد
کامیت
236032f7b5
1فایلهای تغییر یافته به همراه7 افزوده شده و 0 حذف شده
  1. 7 0
      exec/totemconfig.c

+ 7 - 0
exec/totemconfig.c

@@ -1476,6 +1476,7 @@ int totem_config_validate (
 	char parse_error[512];
 	char parse_error[512];
 	const char *error_reason = local_error_reason;
 	const char *error_reason = local_error_reason;
 	int i,j;
 	int i,j;
+	uint32_t u32;
 	int num_configured = 0;
 	int num_configured = 0;
 	unsigned int interface_max = INTERFACE_MAX;
 	unsigned int interface_max = INTERFACE_MAX;
 
 
@@ -1491,6 +1492,12 @@ int totem_config_validate (
 		goto parse_error;
 		goto parse_error;
 	}
 	}
 
 
+	/* Check we found a local node address */
+	if (icmap_get_uint32("nodelist.local_node_pos", &u32) != CS_OK) {
+		error_reason = "No valid address found for local host";
+		goto parse_error;
+	}
+
 	for (i = 0; i < INTERFACE_MAX; i++) {
 	for (i = 0; i < INTERFACE_MAX; i++) {
 		/*
 		/*
 		 * Some error checking of parsed data to make sure its valid
 		 * Some error checking of parsed data to make sure its valid