SOURCES: quagga-rt-netlink.patch (NEW) - correctly parse netlink d...
arekm
arekm at pld-linux.org
Sat Oct 22 22:30:30 CEST 2005
Author: arekm Date: Sat Oct 22 20:30:30 2005 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- correctly parse netlink data for ethernet PtP addresses.
---- Files affected:
SOURCES:
quagga-rt-netlink.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: SOURCES/quagga-rt-netlink.patch
diff -u /dev/null SOURCES/quagga-rt-netlink.patch:1.1
--- /dev/null Sat Oct 22 22:30:30 2005
+++ SOURCES/quagga-rt-netlink.patch Sat Oct 22 22:30:25 2005
@@ -0,0 +1,58 @@
+Index: zebra/rt_netlink.c
+===================================================================
+RCS file: /var/cvsroot/quagga/zebra/rt_netlink.c,v
+retrieving revision 1.39
+diff -b -u -p -r1.39 rt_netlink.c
+--- zebra/rt_netlink.c 1 Oct 2005 16:36:54 -0000 1.39
++++ zebra/rt_netlink.c 22 Oct 2005 18:15:11 -0000
+@@ -629,41 +629,24 @@ netlink_interface_addr (struct sockaddr_
+ zlog_debug (" IFA_LABEL %s", (char *)RTA_DATA (tb[IFA_LABEL]));
+ }
+
++ /* logic copied from iproute2/ip/ipaddress.c:print_addrinfo() */
++ if (tb[IFA_LOCAL] == NULL)
++ tb[IFA_LOCAL] = tb[IFA_ADDRESS];
+ if (tb[IFA_ADDRESS] == NULL)
+ tb[IFA_ADDRESS] = tb[IFA_LOCAL];
+
+- if (ifp->flags & IFF_POINTOPOINT)
+- {
+- if (tb[IFA_LOCAL])
+- {
+- addr = RTA_DATA (tb[IFA_LOCAL]);
++ /* local interface address */
++ addr = (tb[IFA_LOCAL] ? RTA_DATA(tb[IFA_LOCAL]) : NULL);
++
++ /* peer or broadcast address */
+ if (tb[IFA_ADDRESS] &&
+ memcmp(RTA_DATA(tb[IFA_ADDRESS]),RTA_DATA(tb[IFA_LOCAL]),4))
+ /* if IFA_ADDRESS != IFA_LOCAL, then it's the peer address */
+- broad = RTA_DATA (tb[IFA_ADDRESS]);
+- else
+- broad = NULL;
+- }
+- else
+- {
+- if (tb[IFA_ADDRESS])
+- addr = RTA_DATA (tb[IFA_ADDRESS]);
+- else
+- addr = NULL;
+- }
+- }
+- else
+- {
+- if (tb[IFA_ADDRESS])
+- addr = RTA_DATA (tb[IFA_ADDRESS]);
+- else
+- addr = NULL;
+-
+- if (tb[IFA_BROADCAST])
++ broad = RTA_DATA(tb[IFA_ADDRESS]);
++ else if (tb[IFA_BROADCAST])
+ broad = RTA_DATA(tb[IFA_BROADCAST]);
+ else
+ broad = NULL;
+- }
+
+ /* Flags. */
+ if (ifa->ifa_flags & IFA_F_SECONDARY)
================================================================
More information about the pld-cvs-commit
mailing list