summaryrefslogtreecommitdiff
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
commit3fb9cd6ef456959b6eff939d5c316f6785c2dda4 (patch)
treee350cb3ef7b20b8bbccfb1aa9309152311e845bd /lib/zclient.c
parent5ae35f45f1292dce3a01f241accafeb2e59b10cc (diff)
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;
}