Bug 190425 - /etc/ethers file format
/etc/ethers file format
Status: CLOSED RAWHIDE
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: net-tools (Show other bugs)
4.0
All Linux
medium Severity low
: ---
: ---
Assigned To: Radek Vokal
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-05-02 04:11 EDT by Peter Riley
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version: 1.60-69
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-05-02 08:46:38 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Peter Riley 2006-05-02 04:11:41 EDT
Description of problem:

  Hello. I found a contradiction between two of the man
  pages included in the net-tools package while trying
  to set up my /etc/ethers file.

  "man 5 ethers" says to use this format in /etc/ethers:

       AA:BB:CC:DD:EE:FF   www.xxx.yyy.zzz

  However "man 8 arp" says to use the reverse format,
  which would be:

       www.xxx.yyy.zzz   AA:BB:CC:DD:EE:FF

  Which one is correct?

  Running the "arp -f" command definitely chokes when
  the /etc/ethers file is in the format that its own
  "man 5 ethers" page describes.

  But if using the reverse format, might something else
  break? (eg. rarpd)

  -PWR


Version-Release number of selected component (if applicable):

  RHEL 4 U3

How reproducible:

  100%

Steps to Reproduce:
1. man 5 ethers
2. man 8 arp
3. vi /etc/ethers ?!?
Comment 1 Peter Riley 2006-05-02 08:16:21 EDT
Oops.

>  Running the "arp -f" command definitely chokes when
>  the /etc/ethers file is in the format that its own
>  "man 5 ethers" page describes.

Please ignore this part; "arp -f" works well with either
format of the /etc/ethers file. Indeed, it even works when
lines of *both* formats are present together in the same
file.

I became confused because I had unwittingly introduced
extraneous whitespace on several lines in the file while
swapping columns; and unfortunately, arp complains about
extra whitespace on an otherwise blank line. For example,

  echo " " >> /etc/ethers; arp -f

will produce this error

  arp: format error on line %u of etherfile /etc/ethers !

I had mistakenly thought it errored because the columns
had been swapped.

----

Also, while looking through  net-tools-1.60-37.EL4.6.src.rpm
I came across this in arp.c:

380: /* Process an EtherFile */
381: static int arp_file(char *name)
382: {
...
408:     if (strchr (args[0], ':') != NULL) {
409:         /* We have a correct ethers file, switch hw adress and hostname
410:            for arp */
411:         char *cp;
412:         cp = args[1];
413:         args[1] = args[0];
414:         args[0] = cp;
415:     }

If the author of arp says that the "hwaddr ipaddr" order is correct,
the arp manpage must be wrong/unclear.

This bug could be closed, I think, if the ordering in the arp manpage
was switched here:

148:  The format of the file is simple; it
149:  only contains ASCII text lines with a hostname, and a hardware
150:  address separated by whitespace. Additionally the 

-PWR

Comment 2 Radek Vokal 2006-05-02 08:46:38 EDT
I've changed the man page for rawhide, not a big issue for RHEL I think. You're
right that both formats are more or less correct (eg. they are accepted by arp) 

Note You need to log in before you can comment on or make changes to this bug.