]> git.proxmox.com Git - mirror_frr.git/blobdiff - ripngd/ripng_peer.c
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / ripngd / ripng_peer.c
index 0ac489c67ee2232ab88b00ceac02e5dfc83c7596..75a9ed77fee1be7e774d3807b8a11f80f909ce94 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* RIPng peer support
  * Copyright (C) 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /* RIPng support added by Vincent Jardin <vincent.jardin@6wind.com>
@@ -34,7 +19,7 @@
 #include "ripngd/ripngd.h"
 #include "ripngd/ripng_nexthop.h"
 
-DEFINE_MTYPE_STATIC(RIPNGD, RIPNG_PEER, "RIPng peer")
+DEFINE_MTYPE_STATIC(RIPNGD, RIPNG_PEER, "RIPng peer");
 
 static struct ripng_peer *ripng_peer_new(void)
 {
@@ -43,7 +28,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 +60,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 +78,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 +146,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));
        }