From b540897851b3e7eb7975274e5d905af37be271cc Mon Sep 17 00:00:00 2001 From: Jared Yanovich Date: Thu, 17 Feb 2005 17:02:25 +0000 Subject: print the interface name in monitor mode when interfaces go up/down; ok mcbride --- sbin/route/route.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sbin') diff --git a/sbin/route/route.c b/sbin/route/route.c index 187fd444f74..7c096e376fc 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.81 2004/10/14 15:20:56 jaredy Exp $ */ +/* $OpenBSD: route.c,v 1.82 2005/02/17 17:02:24 jaredy Exp $ */ /* $NetBSD: route.c,v 1.16 1996/04/15 18:27:05 cgd Exp $ */ /* @@ -40,7 +40,7 @@ static const char copyright[] = #if 0 static const char sccsid[] = "@(#)route.c 8.3 (Berkeley) 3/19/94"; #else -static const char rcsid[] = "$OpenBSD: route.c,v 1.81 2004/10/14 15:20:56 jaredy Exp $"; +static const char rcsid[] = "$OpenBSD: route.c,v 1.82 2005/02/17 17:02:24 jaredy Exp $"; #endif #endif /* not lint */ @@ -1105,6 +1105,7 @@ print_rtmsg(struct rt_msghdr *rtm, int msglen) struct ifa_msghdr *ifam; struct if_announcemsghdr *ifan; const char *state = "unknown"; + char ifname[IF_NAMESIZE]; if (verbose == 0) return; @@ -1118,6 +1119,8 @@ print_rtmsg(struct rt_msghdr *rtm, int msglen) case RTM_IFINFO: ifm = (struct if_msghdr *)rtm; (void) printf("if# %d, ", ifm->ifm_index); + if (!nflag && if_indextoname(ifm->ifm_index, ifname) != NULL) + (void) printf("name: %s, ", ifname); switch (ifm->ifm_data.ifi_link_state) { case LINK_STATE_DOWN: state = "down"; -- cgit v1.2.3