diff --git a/nhrpd/nhrp_shortcut.c b/nhrpd/nhrp_shortcut.c index 6ad0c9ea03..fbb883185a 100644 --- a/nhrpd/nhrp_shortcut.c +++ b/nhrpd/nhrp_shortcut.c @@ -51,18 +51,26 @@ static int nhrp_shortcut_do_expire(struct thread *t) 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 (unspec) dev %s", - s->p, s->cache->ifp->name); + "Shortcut: route install %pFX nh %s dev %s", + s->p, buf2, c && c->ifp ? + c->ifp->name : ""); - nhrp_route_announce(1, s->type, s->p, s->cache->ifp, - &s->cache->remote_addr, 0); + nhrp_route_announce(1, s->type, s->p, c ? c->ifp : NULL, + c ? &c->remote_addr : NULL, 0); s->route_installed = 1; } break;