]> git.puffer.fish Git - mirror/frr.git/commitdiff
Use the proper field length for the peer's address (netlink_interface_addr)
authorvize <vize>
Fri, 10 Aug 2007 06:25:20 +0000 (06:25 +0000)
committervize <vize>
Fri, 10 Aug 2007 06:25:20 +0000 (06:25 +0000)
zebra/ChangeLog
zebra/rt_netlink.c

index 9bd775e9132d561f1f763a2ac3e4747c3d1a5a6d..f6dea4422e9b004441c6ba21d90b9b275d63ac35 100644 (file)
@@ -1,3 +1,8 @@
+2007-08-10  Emmanuel Vize <emmanuel.vize@6wind.com>
+
+       * rt_netlink.c: (netlink_interface_addr) Use the appropriate field length for the address
+          (acknowledge Andy's comment).
+
 2007-08-06  Denis Ovsienko
 
        * zebra_rib.c: (general) Add extra debug logging for RIB and
index 3b602c45ed41dcc3852b2bcaeaf5de202cf85bb0..5b592f948a23b2468bedfd44f1f409fb08ee5488 100644 (file)
@@ -647,12 +647,8 @@ netlink_interface_addr (struct sockaddr_nl *snl, struct nlmsghdr *h)
   addr = (tb[IFA_LOCAL] ? RTA_DATA(tb[IFA_LOCAL]) : NULL);
 
   /* is there a peer address? */
-  /* N.B. I do not understand why the memcmp compares 4 bytes regardless
-     of address family, but this is exactly how it appears in
-     print_addrinfo.  I wonder if it should be RTA_PAYLOAD(tb[IFA_ADDRESS])
-     instead of 4... */
   if (tb[IFA_ADDRESS] &&
-      memcmp(RTA_DATA(tb[IFA_ADDRESS]), RTA_DATA(tb[IFA_LOCAL]), 4))
+      memcmp(RTA_DATA(tb[IFA_ADDRESS]), RTA_DATA(tb[IFA_LOCAL]), RTA_PAYLOAD(tb[IFA_ADDRESS])))
     {
       broad = RTA_DATA(tb[IFA_ADDRESS]);
       SET_FLAG (flags, ZEBRA_IFA_PEER);