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/e63523cfff99
branches:  netbsd-8
changeset: 435174:e63523cfff99
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Jul 31 17:08:00 2018 +0000

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

diffstat:

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

diffs (38 lines):

diff -r dfbc6e415bf4 -r e63523cfff99 usr.sbin/arp/arp.c
--- a/usr.sbin/arp/arp.c        Tue Jul 31 17:03:50 2018 +0000
+++ b/usr.sbin/arp/arp.c        Tue Jul 31 17:08:00 2018 +0000
@@ -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 @@
 #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 @@
 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 @@
                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)



Home | Main Index | Thread Index | Old Index