summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ripngd/ripng_peer.c6
-rw-r--r--ripngd/ripngd.c2
-rw-r--r--ripngd/ripngd.h1
3 files changed, 9 insertions, 0 deletions
diff --git a/ripngd/ripng_peer.c b/ripngd/ripng_peer.c
index f5590cf823..36c701b86b 100644
--- a/ripngd/ripng_peer.c
+++ b/ripngd/ripng_peer.c
@@ -41,6 +41,7 @@ static struct ripng_peer *ripng_peer_new(void)
static void ripng_peer_free(struct ripng_peer *peer)
{
+ RIPNG_TIMER_OFF(peer->t_timeout);
XFREE(MTYPE_RIPNG_PEER, peer);
}
@@ -178,3 +179,8 @@ int ripng_peer_list_cmp(struct ripng_peer *p1, struct ripng_peer *p2)
{
return memcmp(&p1->addr, &p2->addr, sizeof(struct in6_addr));
}
+
+void ripng_peer_list_del(void *arg)
+{
+ ripng_peer_free(arg);
+}
diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c
index 2cc3bd7f1e..9456980e87 100644
--- a/ripngd/ripngd.c
+++ b/ripngd/ripngd.c
@@ -1807,6 +1807,7 @@ int ripng_create(int socket)
ripng->table = agg_table_init();
ripng->peer_list = list_new();
ripng->peer_list->cmp = (int (*)(void *, void *))ripng_peer_list_cmp;
+ ripng->peer_list->del = ripng_peer_list_del;
ripng->enable_if = vector_init(1);
ripng->enable_network = agg_table_init();
ripng->passive_interface = vector_init(1);
@@ -2459,6 +2460,7 @@ void ripng_clean()
free(ripng->route_map[i].name);
agg_table_finish(ripng->table);
+ list_delete(&ripng->peer_list);
distribute_list_delete(&ripng->distribute_ctx);
stream_free(ripng->ibuf);
diff --git a/ripngd/ripngd.h b/ripngd/ripngd.h
index 3e5ca18ed2..26b6c0bb12 100644
--- a/ripngd/ripngd.h
+++ b/ripngd/ripngd.h
@@ -377,6 +377,7 @@ extern void ripng_peer_display(struct vty *);
extern struct ripng_peer *ripng_peer_lookup(struct in6_addr *);
extern struct ripng_peer *ripng_peer_lookup_next(struct in6_addr *);
extern int ripng_peer_list_cmp(struct ripng_peer *p1, struct ripng_peer *p2);
+extern void ripng_peer_list_del(void *arg);
extern struct ripng_offset_list *ripng_offset_list_new(const char *ifname);
extern void ripng_offset_list_del(struct ripng_offset_list *offset);