summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2010-03-27 18:31:42 +0100
committerDavid Lamparter <equinox@opensourcerouting.org>2017-08-27 23:40:23 +0200
commita3008857cbf5c0122dda88e178d5c4378d7e4591 (patch)
tree4d42ef30dc5a6b94bd13defec1c144d92a2664a1
parentzebra: add connected_check_ptp infrastructure (diff)
downloadfrr-a3008857cbf5c0122dda88e178d5c4378d7e4591.tar.xz
frr-a3008857cbf5c0122dda88e178d5c4378d7e4591.zip
zebra: fix interface deletion bug introduced by ptp address support
meh. forgot to even look at the interface deletion path. this doesn't really work well when looking for the local address in the subnet list which has the connected prefix in it... loop ensues. fix by using the connected prefix when looking at the list of connected prefixes. duh. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
-rw-r--r--zebra/interface.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/zebra/interface.c b/zebra/interface.c
index 9b4af1786..7dcf30d71 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -569,7 +569,7 @@ static void if_uninstall_connected(struct interface *ifp)
static void if_delete_connected(struct interface *ifp)
{
struct connected *ifc;
- struct prefix *p;
+ struct prefix cp;
struct route_node *rn;
struct zebra_if *zebra_if;
@@ -582,11 +582,13 @@ static void if_delete_connected(struct interface *ifp)
while ((node = (last ? last->next
: listhead(ifp->connected)))) {
ifc = listgetdata(node);
- p = ifc->address;
- if (p->family == AF_INET
+ cp = *CONNECTED_PREFIX(ifc);
+ apply_mask(&cp);
+
+ if (cp.family == AF_INET
&& (rn = route_node_lookup(zebra_if->ipv4_subnets,
- p))) {
+ &cp))) {
struct listnode *anode;
struct listnode *next;
struct listnode *first;
@@ -639,7 +641,7 @@ static void if_delete_connected(struct interface *ifp)
list_delete(addr_list);
rn->info = NULL;
route_unlock_node(rn);
- } else if (p->family == AF_INET6) {
+ } else if (cp.family == AF_INET6) {
connected_down_ipv6(ifp, ifc);
zebra_interface_address_delete_update(ifp, ifc);