mirror of
https://git.proxmox.com/git/mirror_corosync
synced 2025-08-03 05:05:29 +00:00
Correctly compare local addresses with bindnetaddr
This patch allows whitetank/corosync to behave correctly when the supplied value of bindnetaddr has more precision than the netmask, but is not a full IPv4 address. For example, currently, if the netmask is /16 but the user specifies 192.168.1.0, then OpenAIS is unable to determine the correct address and uses the loopback address instead. The following patch allows OpenAIS to correctly determine which interface/address to use. git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1702 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
parent
f2f20533fd
commit
a3571b016b
@ -472,7 +472,7 @@ int totemip_iface_check(struct totem_ip_address *bindnet,
|
||||
memcpy(&network, RTA_DATA(tb[IFA_BROADCAST]), sizeof(uint32_t));
|
||||
memcpy(&addr, bindnet->addr, sizeof(uint32_t));
|
||||
|
||||
if (addr == (network & netmask)) {
|
||||
if ((addr & netmask) == (network & netmask)) {
|
||||
memcpy(ipaddr.addr, RTA_DATA(tb[IFA_ADDRESS]), TOTEMIP_ADDRLEN);
|
||||
found_if = 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user