zebra: Add check to notice when an interface is unnumbered
If an interface is not a loopback and it's prefixlen == 32
assume that it is unnumbered.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
diff --git a/zebra/connected.c b/zebra/connected.c
index 84b0d1c..1980007 100644
--- a/zebra/connected.c
+++ b/zebra/connected.c
@@ -77,7 +77,15 @@
{
if (!ifc)
return;
-
+
+ if (!if_is_loopback(ifp) && ifc->address->family == AF_INET)
+ {
+ if (ifc->address->prefixlen == 32)
+ SET_FLAG (ifc->flags, ZEBRA_IFA_UNNUMBERED);
+ else
+ UNSET_FLAG (ifc->flags, ZEBRA_IFA_UNNUMBERED);
+ }
+
listnode_add (ifp->connected, ifc);
/* Update interface address information to protocol daemon. */