Module Name: src Committed By: martin Date: Tue Jul 31 17:08:00 UTC 2018
Modified Files: src/usr.sbin/arp [netbsd-8]: arp.c Log Message: Pull up following revision(s) (requested by nonaka in ticket #957): usr.sbin/arp/arp.c: revision 1.63 arp(8): Fix the host output when arp -dav. To generate a diff of this commit: cvs rdiff -u -r1.55.8.3 -r1.55.8.4 src/usr.sbin/arp/arp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.sbin/arp/arp.c diff -u src/usr.sbin/arp/arp.c:1.55.8.3 src/usr.sbin/arp/arp.c:1.55.8.4 --- src/usr.sbin/arp/arp.c:1.55.8.3 Fri Jul 27 09:55:50 2018 +++ src/usr.sbin/arp/arp.c Tue Jul 31 17:08:00 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: arp.c,v 1.55.8.3 2018/07/27 09:55:50 martin Exp $ */ +/* $NetBSD: arp.c,v 1.55.8.4 2018/07/31 17:08:00 martin Exp $ */ /* * Copyright (c) 1984, 1993 @@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1984, 19 #if 0 static char sccsid[] = "@(#)arp.c 8.3 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: arp.c,v 1.55.8.3 2018/07/27 09:55:50 martin Exp $"); +__RCSID("$NetBSD: arp.c,v 1.55.8.4 2018/07/31 17:08:00 martin Exp $"); #endif #endif /* not lint */ @@ -493,6 +493,7 @@ void delete(const char *host, const char *info) { int mib[6]; + char addr[sizeof("000.000.000.000\0")]; size_t needed; char *lim, *buf, *next; struct rt_msghdr *rtm; @@ -539,8 +540,10 @@ retry: found = true; ret = delete_one(rtm); if (vflag && ret == 0) { - (void)printf("%s (%s) deleted\n", host, + snprintf(addr, sizeof(addr), "%s", inet_ntoa(sina->sin_addr)); + (void)printf("%s (%s) deleted\n", + host != NULL ? host : addr, addr); } } if (host != NULL && !found)