diff options
author | Timo Teräs <timo.teras@iki.fi> | 2016-03-30 13:44:03 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2016-03-30 14:29:40 +0300 |
commit | 8cb40c91cdfb00ddf04e88d3ecd40403890d90f7 (patch) | |
tree | 6d6a3de27525820abb740f1fa8347b6f03986bad /zebra/connected.c | |
parent | 86c5d2ee68f7b9c00ae4aeb5c8b3c5d82c5ebffc (diff) | |
download | quagga-8cb40c91cdfb00ddf04e88d3ecd40403890d90f7.tar.bz2 quagga-8cb40c91cdfb00ddf04e88d3ecd40403890d90f7.tar.xz |
cumulus take-3cumulus-take-3
Diffstat (limited to 'zebra/connected.c')
-rw-r--r-- | zebra/connected.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/zebra/connected.c b/zebra/connected.c index 84b0d1cb..f2f523fa 100644 --- a/zebra/connected.c +++ b/zebra/connected.c @@ -30,6 +30,7 @@ #include "table.h" #include "log.h" #include "memory.h" +#include "vty.h" #include "zebra/zserv.h" #include "zebra/redistribute.h" @@ -77,7 +78,15 @@ connected_announce (struct interface *ifp, struct connected *ifc) { 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. */ @@ -209,6 +218,9 @@ connected_add_ipv4 (struct interface *ifp, int flags, struct in_addr *addr, struct prefix_ipv4 *p; struct connected *ifc; + if (ipv4_martian(addr)) + return; + /* Make connected structure. */ ifc = connected_new (); ifc->ifp = ifp; @@ -370,6 +382,9 @@ connected_add_ipv6 (struct interface *ifp, int flags, struct in6_addr *addr, struct prefix_ipv6 *p; struct connected *ifc; + if (ipv6_martian(addr)) + return; + /* Make connected structure. */ ifc = connected_new (); ifc->ifp = ifp; @@ -464,4 +479,20 @@ connected_delete_ipv6 (struct interface *ifp, struct in6_addr *address, rib_update (ifp->vrf_id); } + +int +connected_is_unnumbered (struct interface *ifp) +{ + struct connected *connected; + struct listnode *node; + + for (ALL_LIST_ELEMENTS_RO (ifp->connected, node, connected)) + { + if (CHECK_FLAG (connected->conf, ZEBRA_IFC_REAL) && + connected->address->family == AF_INET) + return CHECK_FLAG(connected->flags, ZEBRA_IFA_UNNUMBERED); + } + return 0; +} + #endif /* HAVE_IPV6 */ |