From 340c4415f98c3e492ebe6da02882d88c12e70574 Mon Sep 17 00:00:00 2001 From: Jakob Schlyter Date: Fri, 26 Dec 2003 23:50:36 +0000 Subject: print nexthop when logging. ok henning@ --- usr.sbin/bgpd/rde.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'usr.sbin/bgpd') diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index 1f73f6619cb..e51a7d9091d 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.36 2003/12/26 22:41:01 henning Exp $ */ +/* $OpenBSD: rde.c,v 1.37 2003/12/26 23:50:35 jakob Exp $ */ /* * Copyright (c) 2003 Henning Brauer @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -514,6 +515,7 @@ rde_update_log(const char *message, const struct in_addr *prefix, u_int8_t prefixlen) { char *neighbor; + char *nexthop = NULL; if (! (conf->log & BGPD_LOG_UPDATES)) return; @@ -522,11 +524,18 @@ rde_update_log(const char *message, if (neighbor == NULL) return; - logit(LOG_DEBUG, "neighbor %s (AS%u) %s %s/%u", + if (attr != NULL) { + asprintf(&nexthop, " via %s", inet_ntoa(attr->nexthop)); + } + + logit(LOG_DEBUG, "neighbor %s (AS%u) %s %s/%u" + "%s", neighbor, peer->conf.remote_as, message, - inet_ntoa(*prefix), prefixlen); + inet_ntoa(*prefix), prefixlen, + nexthop); free(neighbor); + free(nexthop); } /* -- cgit v1.2.3