Explorar o código

r2550 | sdake | 2009-11-27 15:59:48 -0700 (Fri, 27 Nov 2009) | 3 lines

Patch to use proper IFA on Linux platforms to match interface addresses when
netmask is not 255.255.255.0.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/branches/flatiron@2605 fd59a12c-fef9-0310-b244-a6a79926bd2f
Steven Dake %!s(int64=16) %!d(string=hai) anos
pai
achega
8333dc709f
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      exec/totemip.c

+ 2 - 2
exec/totemip.c

@@ -561,12 +561,12 @@ int totemip_iface_check(struct totem_ip_address *bindnet,
 
 				/* If the address we have is an IPv4 network address, then
 				   substitute the actual IP address of this interface */
-				if (!found_if && tb[IFA_BROADCAST] && ifa->ifa_family == AF_INET) {
+				if (!found_if && tb[IFA_LOCAL] && ifa->ifa_family == AF_INET) {
 					uint32_t network;
 					uint32_t addr;
 					uint32_t netmask = htonl(~((1<<(32-ifa->ifa_prefixlen))-1));
 
-					memcpy(&network, RTA_DATA(tb[IFA_BROADCAST]), sizeof(uint32_t));
+					memcpy(&network, RTA_DATA(tb[IFA_LOCAL]), sizeof(uint32_t));
 					memcpy(&addr, bindnet->addr, sizeof(uint32_t));
 
 					if ((addr & netmask) == (network & netmask)) {