]> git.proxmox.com Git - corosync-pve.git/blob - debian/patches/0007-totem-fix-check-if-all-nodes-have-name-attrs-in-mult.patch
e541d22c684d7fb96b98cf2a16e37353ee442949
[corosync-pve.git] / debian / patches / 0007-totem-fix-check-if-all-nodes-have-name-attrs-in-mult.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 Date: Fri, 14 Jun 2019 18:31:16 +0200
4 Subject: [PATCH] totem: fix check if all nodes have name attrs in multi-link
5 setups
6
7 As totem_config->interfaces entries are _all_ possible links and not
8 only the configured ones we cannot trust that interface[0] is
9 configured at the time of checking, and thus has a valid
10 member_count. So set the members variable to the member_count entry
11 from an actually configured interface and loop over that one.
12
13 This fixes a case where the check for the name property on all nodes
14 for multi links was skipped if link 0 was not configured, as then its
15 member_count was 0.
16
17 Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
18 Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
19 Reviewed-by: Jan Friesse <jfriesse@redhat.com>
20 (cherry picked from commit 7ada508a82680dcf23510e585ec295b10ac5da11)
21 Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
22 ---
23 exec/totemconfig.c | 7 ++++---
24 1 file changed, 4 insertions(+), 3 deletions(-)
25
26 diff --git a/exec/totemconfig.c b/exec/totemconfig.c
27 index ff86e232..dfde90df 100644
28 --- a/exec/totemconfig.c
29 +++ b/exec/totemconfig.c
30 @@ -449,14 +449,15 @@ static int totem_volatile_config_validate (
31 num_configured = 0;
32 for (i = 0; i < INTERFACE_MAX; i++) {
33 if (totem_config->interfaces[i].configured) {
34 + if (num_configured == 0) {
35 + members = totem_config->interfaces[i].member_count;
36 + }
37 num_configured++;
38 }
39 }
40
41 if (num_configured > 1) {
42 - members = totem_config->interfaces[0].member_count;
43 -
44 - for (i=0; i<totem_config->interfaces[0].member_count; i++) {
45 + for (i=0; i < members; i++) {
46 snprintf(name_key, sizeof(name_key), "nodelist.node.%d.name", i);
47
48 if (icmap_get_string(name_key, &name_str) != CS_OK) {