diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2005-06-07 17:45:29 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2005-06-07 17:45:29 +0000 |
commit | 8dcd258a3805b6ae94624fa34aed26ac25fec394 (patch) | |
tree | ad08119666e2719b15f1f2e7bb95891502bbdfc8 /usr.sbin | |
parent | 7550d218a324b28c644b43afcee6b917d70d8930 (diff) |
For show rib -- show_rib_summary_msg() and print_prefix() -- use log_addr()
to print prefixes and nexthops and suddenly we can print IPv6 addresses that
are stored in the RIB. Makes the code even simpler. OK henning@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bgpctl/bgpctl.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/bgpctl/bgpctl.c b/usr.sbin/bgpctl/bgpctl.c index abea9b25330..8b35a67c57d 100644 --- a/usr.sbin/bgpctl/bgpctl.c +++ b/usr.sbin/bgpctl/bgpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpctl.c,v 1.84 2005/06/06 17:15:07 henning Exp $ */ +/* $OpenBSD: bgpctl.c,v 1.85 2005/06/07 17:45:28 claudio Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -924,7 +924,7 @@ print_prefix(struct bgpd_addr *prefix, u_int8_t prefixlen, u_int8_t flags) *p++ = '>'; *p = '\0'; - if (asprintf(&p, "%s/%u", inet_ntoa(prefix->v4), prefixlen) == -1) + if (asprintf(&p, "%s/%u", log_addr(prefix), prefixlen) == -1) err(1, NULL); printf("%-4s %-20s", flagstr, p); free(p); @@ -970,7 +970,7 @@ show_rib_summary_msg(struct imsg *imsg) memcpy(rib, imsg->data, imsg->hdr.len - IMSG_HEADER_SIZE); print_prefix(&rib->prefix, rib->prefixlen, rib->flags); - printf("%-15s ", inet_ntoa(rib->nexthop.v4)); + printf("%-15s ", log_addr(&rib->nexthop)); printf(" %5u %5u ", rib->local_pref, rib->med); @@ -990,7 +990,7 @@ show_rib_summary_msg(struct imsg *imsg) return (0); print_prefix(&p->prefix, p->prefixlen, p->flags); - printf("%-15s ", inet_ntoa(rib->nexthop.v4)); + printf("%-15s ", log_addr(&rib->nexthop)); printf(" %5u %5u ", rib->local_pref, rib->med); |