diff options
author | 2019-11-16 13:14:52 +0000 | |
---|---|---|
committer | 2019-11-16 13:14:52 +0000 | |
commit | 449a8c2d02ded4e77163bfef3d90217164bd800b (patch) | |
tree | 127db1e45ee5e99ab18cea5790004d8f88fafd67 | |
parent | When printing RTM_PROPOSAL messages use "if#" like all the other (diff) | |
download | wireguard-openbsd-449a8c2d02ded4e77163bfef3d90217164bd800b.tar.xz wireguard-openbsd-449a8c2d02ded4e77163bfef3d90217164bd800b.zip |
When printing RTM_PROPOSAL and unspecified message types, print the
interface name if known. As all the other message types do.
ok bluhm@
-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); |