summaryrefslogtreecommitdiffstats
path: root/nhrpd
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2021-03-11 16:02:46 +0100
committerPhilippe Guibert <philippe.guibert@6wind.com>2021-04-12 19:23:57 +0200
commit850b2b70ac49643416c664d4326db530865f91c0 (patch)
tree9d551de81c32b98e39548bd08a61b3d2a77ca9fe /nhrpd
parentnhrpd: add a zebra api to configure neighbor table per interface (diff)
downloadfrr-850b2b70ac49643416c664d4326db530865f91c0.tar.xz
frr-850b2b70ac49643416c664d4326db530865f91c0.zip
nhrp: avoid crashing when terminating interface contexts
avoid crashing when terminating interface contexts. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'nhrpd')
-rw-r--r--nhrpd/nhrp_peer.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/nhrpd/nhrp_peer.c b/nhrpd/nhrp_peer.c
index c1f615d0a..a44190d29 100644
--- a/nhrpd/nhrp_peer.c
+++ b/nhrpd/nhrp_peer.c
@@ -192,10 +192,10 @@ static void *nhrp_peer_create(void *data)
return p;
}
-static void do_peer_hash_free(struct hash_bucket *hb,
- void *arg __attribute__((__unused__)))
+static void do_peer_hash_free(void *hb_data)
{
- struct nhrp_peer *p = hb->data;
+ struct nhrp_peer *p = (struct nhrp_peer *)hb_data;
+
nhrp_peer_check_delete(p);
}
@@ -207,9 +207,10 @@ void nhrp_peer_interface_del(struct interface *ifp)
nifp->peer_hash ? nifp->peer_hash->count : 0);
if (nifp->peer_hash) {
- hash_iterate(nifp->peer_hash, do_peer_hash_free, NULL);
+ hash_clean(nifp->peer_hash, do_peer_hash_free);
assert(nifp->peer_hash->count == 0);
hash_free(nifp->peer_hash);
+ nifp->peer_hash = NULL;
}
}