]> git.proxmox.com Git - mirror_corosync.git/commitdiff
config: if local node addr is wrong, fail with a sensible message
authorChristine Caulfield <ccaulfie@redhat.com>
Mon, 8 Jan 2018 11:05:46 +0000 (11:05 +0000)
committerJan Friesse <jfriesse@redhat.com>
Tue, 9 Jan 2018 16:50:12 +0000 (17:50 +0100)
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>
exec/totemconfig.c

index 53855d7975edbf2daad0ec2c99c32f5114242cc2..62fea072c79414ee4f7258a68ad0d5986635b72c 100644 (file)
@@ -1476,6 +1476,7 @@ int totem_config_validate (
        char parse_error[512];
        const char *error_reason = local_error_reason;
        int i,j;
+       uint32_t u32;
        int num_configured = 0;
        unsigned int interface_max = INTERFACE_MAX;
 
@@ -1491,6 +1492,12 @@ int totem_config_validate (
                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++) {
                /*
                 * Some error checking of parsed data to make sure its valid