From 408371b269629c8eda26f5da48f63ef9ea126361 Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Sat, 16 Nov 2019 13:14:53 +0000 Subject: When printing RTM_PROPOSAL and unspecified message types, print the interface name if known. As all the other message types do. ok bluhm@ --- sbin/route/route.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sbin/route/route.c') 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); -- cgit v1.2.3