]> git.proxmox.com Git - mirror_frr.git/blobdiff - ripngd/ripng_peer.c
ripngd: Cleanup memory allocations on shutdown
[mirror_frr.git] / ripngd / ripng_peer.c
index 479fcaeb54d6a21312f3734b59a1afcc02539ceb..37cfe9833fb722d9e274e197ab1526dbc46aedb4 100644 (file)
@@ -43,7 +43,7 @@ static struct ripng_peer *ripng_peer_new(void)
 
 static void ripng_peer_free(struct ripng_peer *peer)
 {
-       RIPNG_TIMER_OFF(peer->t_timeout);
+       THREAD_OFF(peer->t_timeout);
        XFREE(MTYPE_RIPNG_PEER, peer);
 }
 
@@ -75,15 +75,13 @@ struct ripng_peer *ripng_peer_lookup_next(struct ripng *ripng,
 /* RIPng peer is timeout.
  * Garbage collector.
  **/
-static int ripng_peer_timeout(struct thread *t)
+static void ripng_peer_timeout(struct thread *t)
 {
        struct ripng_peer *peer;
 
        peer = THREAD_ARG(t);
        listnode_delete(peer->ripng->peer_list, peer);
        ripng_peer_free(peer);
-
-       return 0;
 }
 
 /* Get RIPng peer.  At the same time update timeout thread. */
@@ -95,7 +93,7 @@ static struct ripng_peer *ripng_peer_get(struct ripng *ripng,
        peer = ripng_peer_lookup(ripng, addr);
 
        if (peer) {
-               thread_cancel(&peer->t_timeout);
+               THREAD_OFF(peer->t_timeout);
        } else {
                peer = ripng_peer_new();
                peer->ripng = ripng;
@@ -163,8 +161,8 @@ void ripng_peer_display(struct vty *vty, struct ripng *ripng)
        char timebuf[RIPNG_UPTIME_LEN];
 
        for (ALL_LIST_ELEMENTS(ripng->peer_list, node, nnode, peer)) {
-               vty_out(vty, "    %s \n%14s %10d %10d %10d      %s\n",
-                       inet6_ntoa(peer->addr), " ", peer->recv_badpackets,
+               vty_out(vty, "    %pI6 \n%14s %10d %10d %10d      %s\n",
+                       &peer->addr, " ", peer->recv_badpackets,
                        peer->recv_badroutes, ZEBRA_RIPNG_DISTANCE_DEFAULT,
                        ripng_peer_uptime(peer, timebuf, RIPNG_UPTIME_LEN));
        }