summaryrefslogtreecommitdiffstats
path: root/ldpd/adjacency.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-06-29 16:10:15 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-06-29 16:10:15 +0200
commitb440fe5c82f73a4f34ebc59ac07e95f56e1193e0 (patch)
tree8fc9b00b7b2d4057bd70e7d1fa7085a3036733bc /ldpd/adjacency.c
parentMerge pull request #764 from Jafaral/ospfintaddr (diff)
parentMerge pull request #756 from opensourcerouting/isis-redist-fixes (diff)
downloadfrr-b440fe5c82f73a4f34ebc59ac07e95f56e1193e0.tar.xz
frr-b440fe5c82f73a4f34ebc59ac07e95f56e1193e0.zip
Merge remote-tracking branch 'origin/stable/3.0'
Diffstat (limited to 'ldpd/adjacency.c')
-rw-r--r--ldpd/adjacency.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/ldpd/adjacency.c b/ldpd/adjacency.c
index e73d1b51a..5b0723a00 100644
--- a/ldpd/adjacency.c
+++ b/ldpd/adjacency.c
@@ -109,17 +109,19 @@ adj_new(struct in_addr lsr_id, struct hello_source *source,
return (adj);
}
-static void
-adj_del_single(struct adj *adj)
+void
+adj_del(struct adj *adj, uint32_t notif_status)
{
+ struct nbr *nbr = adj->nbr;
+
log_debug("%s: lsr-id %s, %s (%s)", __func__, inet_ntoa(adj->lsr_id),
log_hello_src(&adj->source), af_name(adj_get_af(adj)));
adj_stop_itimer(adj);
RB_REMOVE(global_adj_head, &global.adj_tree, adj);
- if (adj->nbr)
- RB_REMOVE(nbr_adj_head, &adj->nbr->adj_tree, adj);
+ if (nbr)
+ RB_REMOVE(nbr_adj_head, &nbr->adj_tree, adj);
switch (adj->source.type) {
case HELLO_LINK:
RB_REMOVE(ia_adj_head, &adj->source.link.ia->adj_tree, adj);
@@ -130,15 +132,6 @@ adj_del_single(struct adj *adj)
}
free(adj);
-}
-
-void
-adj_del(struct adj *adj, uint32_t notif_status)
-{
- struct nbr *nbr = adj->nbr;
- struct adj *atmp;
-
- adj_del_single(adj);
/*
* If the neighbor still exists but none of its remaining
@@ -146,8 +139,6 @@ adj_del(struct adj *adj, uint32_t notif_status)
* then delete it.
*/
if (nbr && nbr_adj_count(nbr, nbr->af) == 0) {
- RB_FOREACH_SAFE(adj, nbr_adj_head, &nbr->adj_tree, atmp)
- adj_del_single(adj);
session_shutdown(nbr, notif_status, 0, 0);
nbr_del(nbr);
}
@@ -194,7 +185,6 @@ adj_itimer(struct thread *thread)
tnbr_del(leconf, adj->source.target);
return (0);
}
- adj->source.target->adj = NULL;
}
adj_del(adj, S_HOLDTIME_EXP);