]> git.proxmox.com Git - mirror_corosync.git/commitdiff
totemip: compare sin6_scope_id and interface_num
authorliangxin1300 <XLiang@suse.com>
Thu, 20 Feb 2020 05:38:49 +0000 (13:38 +0800)
committerJan Friesse <jfriesse@redhat.com>
Fri, 21 Feb 2020 14:46:22 +0000 (15:46 +0100)
When user configure a specific interface like vlan
with the same IPv6 link-local address, Corosync should
compare sin6_scope_id with interface_num, to make sure got
the right interface to bind

Signed-off-by: liangxin1300 <XLiang@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
exec/totemip.c

index 150d5380fec175c5430b88a1fbbdf085394b6cd4..1e1ea08043265cce74af02feb8d1c3d8a09f32fc 100644 (file)
@@ -573,6 +573,9 @@ int totemip_iface_check(struct totem_ip_address *bindnet,
                if (addr_len == 0)
                        continue ;
 
+               if (bindnet->sin6_scope_id != 0 && bindnet->sin6_scope_id != if_addr->interface_num)
+                       continue;
+
                totemip_copy(&bn_netaddr, bindnet);
                totemip_copy(&if_netaddr, &if_addr->ip_addr);