diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-04-13 09:10:51 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-04-13 09:10:51 +0000 |
commit | 6935b3dce6503604ddbbce52767bf97afb412df0 (patch) | |
tree | a4e8b1afd609bdb38ed74dc2a4f727e7bac69fcd /usr.sbin/bgpctl/bgpctl.c | |
parent | 3f91acda7ecb874041498a8f9f9e0935c1128d3d (diff) |
Sync with last bgpd commit, there are no AF_INET and AF_INET6 specific
kroute messages anymore.
Diffstat (limited to 'usr.sbin/bgpctl/bgpctl.c')
-rw-r--r-- | usr.sbin/bgpctl/bgpctl.c | 47 |
1 files changed, 12 insertions, 35 deletions
diff --git a/usr.sbin/bgpctl/bgpctl.c b/usr.sbin/bgpctl/bgpctl.c index 22b0933d55d..ae9a9e8befc 100644 --- a/usr.sbin/bgpctl/bgpctl.c +++ b/usr.sbin/bgpctl/bgpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpctl.c,v 1.157 2010/03/08 17:02:19 claudio Exp $ */ +/* $OpenBSD: bgpctl.c,v 1.158 2010/04/13 09:10:50 claudio Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -804,56 +804,33 @@ show_fib_flags(u_int16_t flags) int show_fib_msg(struct imsg *imsg) { - struct kroute *k; - struct kroute6 *k6; + struct kroute_full *kf; char *p; switch (imsg->hdr.type) { case IMSG_CTL_KROUTE: case IMSG_CTL_SHOW_NETWORK: - if (imsg->hdr.len < IMSG_HEADER_SIZE + sizeof(struct kroute)) - errx(1, "wrong imsg len"); - k = imsg->data; - - show_fib_flags(k->flags); - - if (asprintf(&p, "%s/%u", inet_ntoa(k->prefix), k->prefixlen) == - -1) - err(1, NULL); - printf("%4i %-20s ", k->priority, p); - free(p); - - if (k->nexthop.s_addr) - printf("%s", inet_ntoa(k->nexthop)); - else if (k->flags & F_CONNECTED) - printf("link#%u", k->ifindex); - printf("\n"); - - break; - case IMSG_CTL_KROUTE6: - case IMSG_CTL_SHOW_NETWORK6: - if (imsg->hdr.len < IMSG_HEADER_SIZE + sizeof(struct kroute6)) + if (imsg->hdr.len < IMSG_HEADER_SIZE + sizeof(*kf)) errx(1, "wrong imsg len"); - k6 = imsg->data; + kf = imsg->data; - show_fib_flags(k6->flags); + show_fib_flags(kf->flags); - if (asprintf(&p, "%s/%u", log_in6addr(&k6->prefix), - k6->prefixlen) == -1) + if (asprintf(&p, "%s/%u", log_addr(&kf->prefix), + kf->prefixlen) == -1) err(1, NULL); - printf("%4i %-20s ", k6->priority, p); + printf("%4i %-20s ", kf->priority, p); free(p); - if (!IN6_IS_ADDR_UNSPECIFIED(&k6->nexthop)) - printf("%s", log_in6addr(&k6->nexthop)); - else if (k6->flags & F_CONNECTED) - printf("link#%u", k6->ifindex); + if (kf->flags & F_CONNECTED) + printf("link#%u", kf->ifindex); + else + printf("%s", log_addr(&kf->nexthop)); printf("\n"); break; case IMSG_CTL_END: return (1); - break; default: break; } |