Subject: misc/3184: arp options-parsing bug, fix.
To: None <gnats-bugs@gnats.netbsd.org>
From: Paul Boven <paul@wit387304.student.utwente.nl>
List: netbsd-bugs
Date: 02/03/1997 00:47:03
>Number: 3184
>Category: misc
>Synopsis: arp -an shows hostnames (shouldn't), arp -na doesn't.
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: misc-bug-people (Misc Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Feb 2 16:05:01 1997
>Last-Modified:
>Originator: Paul Boven
>Organization:
----------------------------------------------------------------------
Paul Boven, <e.p.boven@student.utwente.nl> PE1NUT QRV 145.575 JO32KF
Nothing would get done in the world, if we didn't have insomniacs.
Or at least, nothing would get done at night.
----------------------------------------------------------------------
>Release: NetBSD-current src 1 feb 1997
>Environment:
System: NetBSD wit387304.student.utwente.nl 1.2B NetBSD 1.2B (ELC) #4: Sat Jan 18 17:44:10 CET 1997 paul@wit387304.student.utwente.nl:/usr/src/sys/arch/sparc/compile/ELC sparc
>Description:
Option parsing for arp is dependent on order of the options: arp -na only
shows numeric ip-adresses, arp -an does hostname-lookups (wich it shouldn't).
>How-To-Repeat:
arp -na; arp -an and observe the difference.
>Fix:
first check for the n option, then parse the other options.
diff arp.c arp.c.orig
100,103d99
< if (ch=='n') nflag =1;
< optind = 1;
< optreset = 1;
< while ((ch = getopt(argc, argv, "andsf")) != EOF)
113a110
> nflag = 1;
>Audit-Trail:
>Unformatted: