summaryrefslogtreecommitdiff
path: root/zebra/connected.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/connected.c')
-rw-r--r--zebra/connected.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/zebra/connected.c b/zebra/connected.c
index dc7193eb4c..e1dd0dbdff 100644
--- a/zebra/connected.c
+++ b/zebra/connected.c
@@ -75,7 +75,7 @@ static void connected_announce(struct interface *ifp, struct connected *ifc)
if (!if_is_loopback(ifp) && ifc->address->family == AF_INET &&
!IS_ZEBRA_IF_VRF(ifp)) {
- if (ifc->address->prefixlen == 32)
+ if (ifc->address->prefixlen == IPV4_MAX_BITLEN)
SET_FLAG(ifc->flags, ZEBRA_IFA_UNNUMBERED);
else
UNSET_FLAG(ifc->flags, ZEBRA_IFA_UNNUMBERED);
@@ -330,8 +330,8 @@ void connected_add_ipv4(struct interface *ifp, int flags, struct in_addr *addr,
p = prefix_ipv4_new();
p->family = AF_INET;
p->prefix = *addr;
- p->prefixlen = CHECK_FLAG(flags, ZEBRA_IFA_PEER) ? IPV4_MAX_PREFIXLEN
- : prefixlen;
+ p->prefixlen =
+ CHECK_FLAG(flags, ZEBRA_IFA_PEER) ? IPV4_MAX_BITLEN : prefixlen;
ifc->address = (struct prefix *)p;
/* If there is a peer address. */
@@ -358,8 +358,7 @@ void connected_add_ipv4(struct interface *ifp, int flags, struct in_addr *addr,
}
/* no destination address was supplied */
- if (!dest && (prefixlen == IPV4_MAX_PREFIXLEN)
- && if_is_pointopoint(ifp))
+ if (!dest && (prefixlen == IPV4_MAX_BITLEN) && if_is_pointopoint(ifp))
zlog_debug(
"PtP interface %s with addr %pI4/%d needs a peer address",
ifp->name, addr, prefixlen);
@@ -512,8 +511,8 @@ void connected_delete_ipv4(struct interface *ifp, int flags,
memset(&p, 0, sizeof(struct prefix));
p.family = AF_INET;
p.u.prefix4 = *addr;
- p.prefixlen = CHECK_FLAG(flags, ZEBRA_IFA_PEER) ? IPV4_MAX_PREFIXLEN
- : prefixlen;
+ p.prefixlen =
+ CHECK_FLAG(flags, ZEBRA_IFA_PEER) ? IPV4_MAX_BITLEN : prefixlen;
if (dest) {
memset(&d, 0, sizeof(struct prefix));