diff options
-rw-r--r-- | sbin/route/show.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/sbin/route/show.c b/sbin/route/show.c index 4a8296659d9..72e7a0b6190 100644 --- a/sbin/route/show.c +++ b/sbin/route/show.c @@ -1,4 +1,4 @@ -/* $OpenBSD: show.c,v 1.62 2008/04/28 11:36:14 norby Exp $ */ +/* $OpenBSD: show.c,v 1.63 2008/04/30 12:43:23 norby Exp $ */ /* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */ /* @@ -205,9 +205,30 @@ p_rttables(int af, u_int tableid) * width of destination/gateway column * strlen("fe80::aaaa:bbbb:cccc:dddd@gif0") == 30, strlen("/128") == 4 */ -#define WID_DST(af) ((af) == AF_INET6 ? (nflag ? 34 : 18) : 18) #define WID_GW(af) ((af) == AF_INET6 ? (nflag ? 30 : 18) : 18) +int +WID_DST(int af) +{ + + if (nflag) + switch (af) { + case AF_MPLS: + return 48; + case AF_INET6: + return 34; + default: + return 18; + } + else + switch (af) { + case AF_MPLS: + return 48; + default: + return 18; + } +} + /* * Print header for routing table columns. */ |