]> git.proxmox.com Git - mirror_frr.git/blobdiff - nhrpd/nhrp_shortcut.c
*: auto-convert to SPDX License IDs
[mirror_frr.git] / nhrpd / nhrp_shortcut.c
index 244273cd5891447f24addceb1b97e9b72b1b6e76..90fb1d67c285532e7afcdb8583323ee5957ff840 100644 (file)
@@ -1,10 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* NHRP shortcut related functions
  * Copyright (c) 2014-2015 Timo Teräs
- *
- * This file is free software: you may copy, redistribute and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -22,7 +18,7 @@ DEFINE_MTYPE_STATIC(NHRPD, NHRP_SHORTCUT, "NHRP shortcut");
 
 static struct route_table *shortcut_rib[AFI_MAX];
 
-static int nhrp_shortcut_do_purge(struct thread *t);
+static void nhrp_shortcut_do_purge(struct thread *t);
 static void nhrp_shortcut_delete(struct nhrp_shortcut *s);
 static void nhrp_shortcut_send_resolution_req(struct nhrp_shortcut *s);
 
@@ -35,7 +31,7 @@ static void nhrp_shortcut_check_use(struct nhrp_shortcut *s)
        }
 }
 
-static int nhrp_shortcut_do_expire(struct thread *t)
+static void nhrp_shortcut_do_expire(struct thread *t)
 {
        struct nhrp_shortcut *s = THREAD_ARG(t);
 
@@ -43,30 +39,22 @@ static int nhrp_shortcut_do_expire(struct thread *t)
                         &s->t_timer);
        s->expiring = 1;
        nhrp_shortcut_check_use(s);
-
-       return 0;
 }
 
 static void nhrp_shortcut_cache_notify(struct notifier_block *n,
                                       unsigned long cmd)
 {
-       char buf2[PREFIX_STRLEN];
-
        struct nhrp_shortcut *s =
                container_of(n, struct nhrp_shortcut, cache_notifier);
        struct nhrp_cache *c = s->cache;
 
-       if (c)
-               sockunion2str(&c->remote_addr, buf2, sizeof(buf2));
-       else
-               snprintf(buf2, sizeof(buf2), "(unspec)");
        switch (cmd) {
        case NOTIFY_CACHE_UP:
                if (!s->route_installed) {
                        debugf(NHRP_DEBUG_ROUTE,
-                              "Shortcut: route install %pFX nh %s dev %s",
-                              s->p, buf2, c && c->ifp ?
-                              c->ifp->name : "<unk>");
+                              "Shortcut: route install %pFX nh %pSU dev %s",
+                              s->p, &c->remote_addr,
+                              c && c->ifp ? c->ifp->name : "<unk>");
 
                        nhrp_route_announce(1, s->type, s->p, c ? c->ifp : NULL,
                                            c ? &c->remote_addr : NULL, 0);
@@ -166,12 +154,11 @@ static void nhrp_shortcut_delete(struct nhrp_shortcut *s)
        }
 }
 
-static int nhrp_shortcut_do_purge(struct thread *t)
+static void nhrp_shortcut_do_purge(struct thread *t)
 {
        struct nhrp_shortcut *s = THREAD_ARG(t);
        s->t_timer = NULL;
        nhrp_shortcut_delete(s);
-       return 0;
 }
 
 static struct nhrp_shortcut *nhrp_shortcut_get(struct prefix *p)