]> git.proxmox.com Git - mirror_corosync.git/commitdiff
knet: Fix display of links with unconfigured link0
authorChristine Caulfield <ccaulfie@redhat.com>
Fri, 16 Mar 2018 10:09:39 +0000 (10:09 +0000)
committerJan Friesse <jfriesse@redhat.com>
Fri, 16 Mar 2018 12:11:13 +0000 (13:11 +0100)
because totemknet always configures link0 as loopback even
if it's not known to corosync, we need to filter it
out when returning the link status, as things get misaligned
in cfg.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
exec/totemknet.c

index 9886bbe6e0fc7d31b3e5f80a65c2d0524b91dfe4..70ef8bac92c7b4b4b4244aacdbee3fb76b257a39 100644 (file)
@@ -403,6 +403,7 @@ int totemknet_ifaces_get (void *knet_context,
        uint8_t link_list[KNET_MAX_LINK];
        size_t num_hosts;
        size_t num_links;
+       size_t link_idx;
        int i,j;
        char *ptr;
        int res = 0;
@@ -435,8 +436,17 @@ int totemknet_ifaces_get (void *knet_context,
                                return (-1);
                        }
 
+                       link_idx = 0;
                        for (i=0; i < num_links; i++) {
-                               ptr = instance->link_status[link_list[i]];
+                               /*
+                                * Skip over links that are unconfigured to corosync. This is basically
+                                * link0 if corosync isn't using it for comms, as we will still
+                                * have it set up for loopback.
+                                */
+                               if (!instance->totem_config->interfaces[link_list[i]].configured) {
+                                       continue;
+                               }
+                               ptr = instance->link_status[link_idx++];
 
                                res = knet_link_get_status(instance->knet_handle,
                                                           host_list[j],