diff options
author | Jakob Schlyter <jakob@cvs.openbsd.org> | 2003-12-26 23:50:36 +0000 |
---|---|---|
committer | Jakob Schlyter <jakob@cvs.openbsd.org> | 2003-12-26 23:50:36 +0000 |
commit | 340c4415f98c3e492ebe6da02882d88c12e70574 (patch) | |
tree | 54b6420eac4179126f502cec359ee333ed083739 /usr.sbin/bgpd/rde.c | |
parent | 759d1e70322e6743d03b9f2f66fc2265c1ca4ef4 (diff) |
print nexthop when logging. ok henning@
Diffstat (limited to 'usr.sbin/bgpd/rde.c')
-rw-r--r-- | usr.sbin/bgpd/rde.c | 15 |
1 files changed, 12 insertions, 3 deletions
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 <henning@openbsd.org> @@ -21,6 +21,7 @@ #include <errno.h> #include <pwd.h> #include <poll.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> @@ -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); } /* |