Subject: misc/3184: arp options-parsing bug, fix.
To: None <>
From: Paul Boven <>
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
>Originator:     Paul Boven
Paul Boven, <>  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
System: NetBSD 1.2B NetBSD 1.2B (ELC) #4: Sat Jan 18 17:44:10 CET 1997 sparc

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).
arp -na; arp -an and observe the difference.
first check for the n option, then parse the other options.
diff arp.c arp.c.orig
< 		if (ch=='n') nflag =1;
< 	optind = 1;
< 	optreset = 1;
< 	while ((ch = getopt(argc, argv, "andsf")) != EOF)
> 			nflag = 1;