diff options
| author | David Lamparter <equinox@diac24.net> | 2010-01-30 12:10:23 +0100 |
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2017-08-27 23:31:02 +0200 |
| commit | abffde07a3f89f77dc45b7660323e41c39d4113c (patch) | |
| tree | 45d91bff33e1909353eb48bdd1c47b3918c30e9b /zebra/interface.c | |
| parent | 3df31ebb0328b4b84fa11d5fbd956dcc30c44dfe (diff) | |
zebra: add connected_check_ptp infrastructure
add a connected_check_ptp function which does the same as
connected_check, but takes an additional peer prefix argument.
also fix related prefixlen mixup in PtP addresses (the local part of a
PtP address always is /32, but previously the peer mask got copied.)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'zebra/interface.c')
| -rw-r--r-- | zebra/interface.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/zebra/interface.c b/zebra/interface.c index c17e408ea0..9b4af1786e 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -242,7 +242,7 @@ int if_subnet_add(struct interface *ifp, struct connected *ifc) /* Get address derived subnet node and associated address list, while marking address secondary attribute appropriately. */ - cp = *ifc->address; + cp = *CONNECTED_PREFIX(ifc); apply_mask(&cp); rn = route_node_get(zebra_if->ipv4_subnets, &cp); @@ -267,12 +267,16 @@ int if_subnet_delete(struct interface *ifp, struct connected *ifc) struct route_node *rn; struct zebra_if *zebra_if; struct list *addr_list; + struct prefix cp; assert(ifp && ifp->info && ifc); zebra_if = ifp->info; + cp = *CONNECTED_PREFIX(ifc); + apply_mask(&cp); + /* Get address derived subnet node. */ - rn = route_node_lookup(zebra_if->ipv4_subnets, ifc->address); + rn = route_node_lookup(zebra_if->ipv4_subnets, &cp); if (!(rn && rn->info)) { zlog_warn( "Trying to remove an address from an unknown subnet." @@ -966,6 +970,8 @@ static void connected_dump_vty(struct vty *vty, struct connected *connected) vty_out(vty, (CONNECTED_PEER(connected) ? " peer " : " broadcast ")); prefix_vty_out(vty, connected->destination); + if (CONNECTED_PEER(connected)) + vty_out(vty, "/%d", connected->destination->prefixlen); } if (CHECK_FLAG(connected->flags, ZEBRA_IFA_SECONDARY)) |
