diff options
-rw-r--r-- | ripd/rip_peer.c | 6 | ||||
-rw-r--r-- | ripd/ripd.c | 2 | ||||
-rw-r--r-- | ripd/ripd.h | 1 |
3 files changed, 9 insertions, 0 deletions
diff --git a/ripd/rip_peer.c b/ripd/rip_peer.c index ca3f25e94..07b295030 100644 --- a/ripd/rip_peer.c +++ b/ripd/rip_peer.c @@ -36,6 +36,7 @@ static struct rip_peer *rip_peer_new(void) static void rip_peer_free(struct rip_peer *peer) { + RIP_TIMER_OFF(peer->t_timeout); XFREE(MTYPE_RIP_PEER, peer); } @@ -174,3 +175,8 @@ int rip_peer_list_cmp(struct rip_peer *p1, struct rip_peer *p2) return (htonl(p1->addr.s_addr) < htonl(p2->addr.s_addr)) ? -1 : 1; } + +void rip_peer_list_del(void *arg) +{ + rip_peer_free(arg); +} diff --git a/ripd/ripd.c b/ripd/ripd.c index 49787db2b..a6cfd9b15 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -2609,6 +2609,7 @@ int rip_create(int socket) rip->neighbor = route_table_init(); rip->peer_list = list_new(); rip->peer_list->cmp = (int (*)(void *, void *))rip_peer_list_cmp; + rip->peer_list->del = rip_peer_list_del; rip->distance_table = route_table_init(); rip->distance_table->cleanup = rip_distance_table_node_cleanup; rip->enable_interface = vector_init(1); @@ -3288,6 +3289,7 @@ void rip_clean(void) route_table_finish(rip->table); route_table_finish(rip->neighbor); + list_delete(&rip->peer_list); distribute_list_delete(&rip->distribute_ctx); rip_clean_network(); diff --git a/ripd/ripd.h b/ripd/ripd.h index 6936ad123..af0d3021a 100644 --- a/ripd/ripd.h +++ b/ripd/ripd.h @@ -449,6 +449,7 @@ extern void rip_peer_display(struct vty *); extern struct rip_peer *rip_peer_lookup(struct in_addr *); extern struct rip_peer *rip_peer_lookup_next(struct in_addr *); extern int rip_peer_list_cmp(struct rip_peer *p1, struct rip_peer *p2); +extern void rip_peer_list_del(void *arg); extern void rip_info_free(struct rip_info *); extern struct rip_distance *rip_distance_new(void); |