diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2019-11-16 13:14:53 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2019-11-16 13:14:53 +0000 |
commit | 408371b269629c8eda26f5da48f63ef9ea126361 (patch) | |
tree | fb4953cf844d155a1103f46c32bf333eeab3bc5e /sbin/route/route.c | |
parent | d9abbf713e3200de943d55196030a6b4563cd7cc (diff) |
When printing RTM_PROPOSAL and unspecified message types, print the
interface name if known. As all the other message types do.
ok bluhm@
Diffstat (limited to 'sbin/route/route.c')
-rw-r--r-- | sbin/route/route.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c index 6433f1287ab..5915d53b2c5 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.241 2019/11/16 12:58:33 krw Exp $ */ +/* $OpenBSD: route.c,v 1.242 2019/11/16 13:14:52 krw Exp $ */ /* $NetBSD: route.c,v 1.16 1996/04/15 18:27:05 cgd Exp $ */ /* @@ -1298,6 +1298,8 @@ print_rtmsg(struct rt_msghdr *rtm, int msglen) } printf(" table %u, if# %u, ", rtm->rtm_tableid, rtm->rtm_index); + if (if_indextoname(rtm->rtm_index, ifname) != NULL) + printf("name %s, ", ifname); printf("pid: %ld, seq %d, errno %d\nflags:", (long)rtm->rtm_pid, rtm->rtm_seq, rtm->rtm_errno); bprintf(stdout, rtm->rtm_flags, routeflags); @@ -1364,6 +1366,8 @@ print_rtmsg(struct rt_msghdr *rtm, int msglen) default: printf(", priority %u, table %u, if# %u, ", rtm->rtm_priority, rtm->rtm_tableid, rtm->rtm_index); + if (if_indextoname(rtm->rtm_index, ifname) != NULL) + printf("name %s, ", ifname); printf("pid: %ld, seq %d, errno %d\nflags:", (long)rtm->rtm_pid, rtm->rtm_seq, rtm->rtm_errno); bprintf(stdout, rtm->rtm_flags, routeflags); |