Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/usr.sbin/arp Pull up following revision(s) (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/45906345f80f
branches:  netbsd-8
changeset: 435158:45906345f80f
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Jul 27 09:55:50 2018 +0000

description:
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.

diffstat:

 usr.sbin/arp/arp.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (42 lines):

diff -r 89814523b05a -r 45906345f80f usr.sbin/arp/arp.c
--- a/usr.sbin/arp/arp.c        Fri Jul 27 00:00:01 2018 +0000
+++ b/usr.sbin/arp/arp.c        Fri Jul 27 09:55:50 2018 +0000
@@ -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 @@
 #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 @@
        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 @@
                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);
 }
 



Home | Main Index | Thread Index | Old Index