summaryrefslogtreecommitdiffstats
path: root/lib/zclient.c
diff options
context:
space:
mode:
authorhasso <hasso>2004-10-19 19:44:43 +0000
committerhasso <hasso>2004-10-19 19:44:43 +0000
commitb1ef841a33839c8169570b18995c1f11847b7a00 (patch)
tree99bb1bcff310939d9128fc89154b63dfbd8753fb /lib/zclient.c
parent00b65ae1f8e2d8f3f54b54b0a84ff55d33aff077 (diff)
downloadquagga-b1ef841a33839c8169570b18995c1f11847b7a00.tar.bz2
quagga-b1ef841a33839c8169570b18995c1f11847b7a00.tar.xz
OK. Here it is - PtP patch from Andrew J. Schorr. No problems with ospfd,
ripd might need some more testing though.
Diffstat (limited to 'lib/zclient.c')
-rw-r--r--lib/zclient.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/zclient.c b/lib/zclient.c
index 98829f61..dfb2f2fc 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -644,6 +644,17 @@ zebra_interface_if_set_value (struct stream *s, struct interface *ifp)
ifp->bandwidth = stream_getl (s);
}
+static int
+memconstant(const void *s, int c, size_t n)
+{
+ const u_char *p = s;
+
+ while (n-- > 0)
+ if (*p++ != c)
+ return 0;
+ return 1;
+}
+
struct connected *
zebra_interface_address_read (int type, struct stream *s)
{
@@ -688,7 +699,9 @@ zebra_interface_address_read (int type, struct stream *s)
if (type == ZEBRA_INTERFACE_ADDRESS_ADD)
{
- ifc = connected_add_by_prefix(ifp, &p, &d);
+ /* N.B. NULL destination pointers are encoded as all zeroes */
+ ifc = connected_add_by_prefix(ifp, &p,(memconstant(&d.u.prefix,0,plen) ?
+ NULL : &d));
if (ifc != NULL)
ifc->flags = ifc_flags;
}