summaryrefslogtreecommitdiffstats
path: root/usr.sbin/arp
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2001-10-08 11:52:23 +0000
committerru <ru@FreeBSD.org>2001-10-08 11:52:23 +0000
commit1671bd567b7d57771d19f2818eecbea6189e2a8a (patch)
treeed3d42375213fa87f93e762ad808f0522404ee70 /usr.sbin/arp
parent28baac583a7e98ff29cf97f76f36e97ecacd026b (diff)
downloadFreeBSD-src-1671bd567b7d57771d19f2818eecbea6189e2a8a.zip
FreeBSD-src-1671bd567b7d57771d19f2818eecbea6189e2a8a.tar.gz
Print interface name for each ARP entry.
Prodded by: Igor Podlesny <poige@morning.ru> MFC after: 1 week
Diffstat (limited to 'usr.sbin/arp')
-rw-r--r--usr.sbin/arp/arp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/usr.sbin/arp/arp.c b/usr.sbin/arp/arp.c
index 94ca7ba..0ab907c 100644
--- a/usr.sbin/arp/arp.c
+++ b/usr.sbin/arp/arp.c
@@ -479,6 +479,7 @@ print_entry(struct sockaddr_dl *sdl,
{
const char *host;
struct hostent *hp;
+ char ifname[IF_NAMESIZE];
int seg;
if (nflag == 0)
@@ -498,6 +499,8 @@ print_entry(struct sockaddr_dl *sdl,
ether_print(LLADDR(sdl));
else
printf("(incomplete)");
+ if (if_indextoname(sdl->sdl_index, ifname) != NULL)
+ printf(" on %s", ifname);
if (rtm->rtm_rmx.rmx_expire == 0)
printf(" permanent");
if (sin->sin_other & SIN_PROXY)
OpenPOWER on IntegriCloud