Module Name: src
Committed By: martin
Date: Fri Jul 27 09:55:50 UTC 2018
Modified Files:
src/usr.sbin/arp [netbsd-8]: arp.c
Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #925):
usr.sbin/arp/arp.c: revision 1.62
arp: warn if failed to delete a specified arp entry
This restores the original behavior of arp in NetBSD 7.
To generate a diff of this commit:
cvs rdiff -u -r1.55.8.2 -r1.55.8.3 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.2 src/usr.sbin/arp/arp.c:1.55.8.3
--- src/usr.sbin/arp/arp.c:1.55.8.2 Mon Jun 11 08:50:31 2018
+++ src/usr.sbin/arp/arp.c Fri Jul 27 09:55:50 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: arp.c,v 1.55.8.2 2018/06/11 08:50:31 martin Exp $ */
+/* $NetBSD: arp.c,v 1.55.8.3 2018/07/27 09:55:50 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.2 2018/06/11 08:50:31 martin Exp $");
+__RCSID("$NetBSD: arp.c,v 1.55.8.3 2018/07/27 09:55:50 martin Exp $");
#endif
#endif /* not lint */
@@ -498,6 +498,7 @@ delete(const char *host, const char *inf
struct rt_msghdr *rtm;
struct sockaddr_inarp *sina;
struct sockaddr_inarp sin_m = blank_sin; /* struct copy */
+ bool found = false;
if (host != NULL) {
int ret = getinetaddr(host, &sin_m.sin_addr);
@@ -535,12 +536,15 @@ retry:
if (host != NULL &&
sina->sin_addr.s_addr != sin_m.sin_addr.s_addr)
continue;
+ found = true;
ret = delete_one(rtm);
if (vflag && ret == 0) {
(void)printf("%s (%s) deleted\n", host,
inet_ntoa(sina->sin_addr));
}
}
+ if (host != NULL && !found)
+ warnx("delete: can't locate %s", host);
free(buf);
}