summaryrefslogtreecommitdiffstats
path: root/usr.sbin/arp/arp.c
diff options
context:
space:
mode:
authorfgsch <fgsch@openbsd.org>2002-12-03 22:33:50 +0000
committerfgsch <fgsch@openbsd.org>2002-12-03 22:33:50 +0000
commita1c4b2602a3c30589bd47caf5d3d85b6168d607e (patch)
tree95fcf82128de526ed5fe2bc216832adc112f23dc /usr.sbin/arp/arp.c
parentansify, indent, check for malloc/calloc failure, proper usage() (diff)
downloadwireguard-openbsd-a1c4b2602a3c30589bd47caf5d3d85b6168d607e.tar.xz
wireguard-openbsd-a1c4b2602a3c30589bd47caf5d3d85b6168d607e.zip
print the interface related to the arp entry; several ppl ok.
Diffstat (limited to 'usr.sbin/arp/arp.c')
-rw-r--r--usr.sbin/arp/arp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/arp/arp.c b/usr.sbin/arp/arp.c
index 33ae4eb5ed7..22fbd38c61f 100644
--- a/usr.sbin/arp/arp.c
+++ b/usr.sbin/arp/arp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arp.c,v 1.24 2002/09/06 18:33:16 deraadt Exp $ */
+/* $OpenBSD: arp.c,v 1.25 2002/12/03 22:33:50 fgsch Exp $ */
/* $NetBSD: arp.c,v 1.12 1995/04/24 13:25:18 cgd Exp $ */
/*
@@ -45,7 +45,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)arp.c 8.2 (Berkeley) 1/2/94";*/
-static char *rcsid = "$OpenBSD: arp.c,v 1.24 2002/09/06 18:33:16 deraadt Exp $";
+static char *rcsid = "$OpenBSD: arp.c,v 1.25 2002/12/03 22:33:50 fgsch Exp $";
#endif /* not lint */
/*
@@ -471,6 +471,7 @@ print_entry(sdl, sin, rtm)
char *host;
extern int h_errno;
struct hostent *hp;
+ char ifname[IF_NAMESIZE];
if (nflag == 0)
hp = gethostbyaddr((caddr_t)&(sin->sin_addr),
@@ -489,6 +490,8 @@ print_entry(sdl, sin, rtm)
ether_print(LLADDR(sdl));
else
(void)printf("(incomplete)");
+ if (if_indextoname(sdl->sdl_index, ifname) != NULL)
+ printf(" on %s", ifname);
if (rtm->rtm_flags & RTF_PERMANENT_ARP)
(void)printf(" permanent");
if (rtm->rtm_rmx.rmx_expire == 0)