[PATCH] Correctly handle point-to-point IP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Main difference between IFA_LOCAL and IFA_ADDRESS:

IFA_ADDRESS is prefix address, rather than local interface address.
It makes no difference for normally configured broadcast interfaces,
but for point-to-point IFA_ADDRESS is DESTINATION address,
local address is supplied in IFA_LOCAL attribute.

We are now using IFA_LOCAL insted of IFA_ADDRESS to correctly find out
local address.

Signed-off-by: Jan Friesse <jfriesse@xxxxxxxxxx>
---
 exec/totemip.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/exec/totemip.c b/exec/totemip.c
index 31dd61e..5258c95 100644
--- a/exec/totemip.c
+++ b/exec/totemip.c
@@ -596,9 +596,11 @@ int totemip_iface_check(struct totem_ip_address *bindnet,
 
 				parse_rtattr(tb, IFA_MAX, IFA_RTA(ifa), len);
 
-				memcpy(ipaddr.addr, RTA_DATA(tb[IFA_ADDRESS]), TOTEMIP_ADDRLEN);
-				if (totemip_equal(&ipaddr, bindnet)) {
-					found_if = 1;
+				if (tb[IFA_LOCAL]) {
+					memcpy(ipaddr.addr, RTA_DATA(tb[IFA_LOCAL]), TOTEMIP_ADDRLEN);
+					if (totemip_equal(&ipaddr, bindnet)) {
+						found_if = 1;
+					}
 				}
 
 				/* If the address we have is an IPv4 network address, then
-- 
1.7.1

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux