diff options
author | David Lamparter <equinox@diac24.net> | 2010-01-30 12:10:23 +0100 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2010-02-03 05:24:58 +0100 |
commit | 4215c0117a843d324c7a33ac56244252f0f40ed6 (patch) | |
tree | b370bc8f97dda6a6dc1e658eb5862d496a73b247 /zebra/interface.c | |
parent | 63cf3e60162a47952d1578d574d7d9186df936c0 (diff) | |
download | quagga-4215c0117a843d324c7a33ac56244252f0f40ed6.tar.bz2 quagga-4215c0117a843d324c7a33ac56244252f0f40ed6.tar.xz |
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.)
Diffstat (limited to 'zebra/interface.c')
-rw-r--r-- | zebra/interface.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/zebra/interface.c b/zebra/interface.c index aa078925..7c2fbe9c 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -127,7 +127,7 @@ 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); @@ -154,12 +154,16 @@ 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)) return -1; route_unlock_node (rn); @@ -588,6 +592,7 @@ connected_dump_vty (struct vty *vty, struct connected *connected) { vty_out (vty, (CONNECTED_PEER(connected) ? " peer " : " broadcast ")); prefix_vty_out (vty, connected->destination); + vty_out (vty, "/%d", connected->destination->prefixlen); } if (CHECK_FLAG (connected->flags, ZEBRA_IFA_SECONDARY)) |