From owner-freebsd-net@FreeBSD.ORG  Mon Jul  7 10:36:57 2003
Return-Path: <owner-freebsd-net@FreeBSD.ORG>
Delivered-To: freebsd-net@freebsd.org
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP
	id 755FE37B401; Mon,  7 Jul 2003 10:36:57 -0700 (PDT)
Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68])
	by mx1.FreeBSD.org (Postfix) with ESMTP
	id 3440B43F3F; Mon,  7 Jul 2003 10:36:56 -0700 (PDT)
	(envelope-from marck@rinet.ru)
Received: from localhost (localhost [127.0.0.1])
	by woozle.rinet.ru (8.12.9/8.12.9) with ESMTP id h67Hassp000432;
	Mon, 7 Jul 2003 21:36:54 +0400 (MSD)
	(envelope-from marck@rinet.ru)
Date: Mon, 7 Jul 2003 21:36:54 +0400 (MSD)
From: Dmitry Morozovsky <marck@rinet.ru>
To: Don Lewis <truckman@FreeBSD.org>
In-Reply-To: <200307071723.h67HNhM7008249@gw.catspoiler.org>
Message-ID: <20030707213257.N48906@woozle.rinet.ru>
References: <200307071723.h67HNhM7008249@gw.catspoiler.org>
X-NCC-RegID: ru.rinet
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
cc: freebsd-net@FreeBSD.org
Subject: Re: Request for Review: bin/54151
X-BeenThere: freebsd-net@freebsd.org
X-Mailman-Version: 2.1.1
Precedence: list
List-Id: Networking and TCP/IP with FreeBSD <freebsd-net.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-net>,
	<mailto:freebsd-net-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-net>
List-Post: <mailto:freebsd-net@freebsd.org>
List-Help: <mailto:freebsd-net-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-net>,
	<mailto:freebsd-net-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 07 Jul 2003 17:36:57 -0000


DL> > would you please spend a bit of your time to review
DL> > http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/54151
DL> > [patch to add -i option to arp(8)]?
DL> >
DL> > Thanks in advance; please keep me CC:d as I'm not subscribet to -net.
DL>
DL> The first patch looks ok except for the text of the error message at
DL> source line 157.

Well, it's a piece of old junk: firstly, I used strdup(), and then realized it
isn't necessary for argv. So, these lines possibly should look simply like

@@ -151,6 +154,11 @@
                case 'f' :
                        SETFUNC(F_FILESET);
                        break;
+               case 'i':
+                       rifname = optarg;
+                       if (checkifname(rifname) == 0)
+                               errx(1, "no such interface: %s", rifname);
+                       break;
                case '?':
                default:
                        usage();

DL> I don't think the second patch is necessary.  It might be better to
DL> print a error message if no matching arp entries are found, since each
DL> broadcast interface should at least have its own permanent arp entry.
DL> Checking versus the full interface list doesn't do the correct thing in
DL> any case since non-broadcast interfaces like lo0, serial WAN interfaces,
DL> etc., don't have arp entries.  Should
DL> 	arp -i lo0 -a
DL> be totally silent, or should it print an error message?

Yeah, that was exactly the cause I have separated these two patches. ;-)

Sincerely,
D.Marck                                     [DM5020, MCK-RIPE, DM3-RIPN]
------------------------------------------------------------------------
*** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru ***
------------------------------------------------------------------------