From 3fb9cd6ef456959b6eff939d5c316f6785c2dda4 Mon Sep 17 00:00:00 2001 From: hasso Date: Tue, 19 Oct 2004 19:44:43 +0000 Subject: OK. Here it is - PtP patch from Andrew J. Schorr. No problems with ospfd, ripd might need some more testing though. --- lib/zclient.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'lib/zclient.c') 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; } -- cgit v1.2.1