Bug 190425 - /etc/ethers file format
Summary: /etc/ethers file format
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: net-tools   
(Show other bugs)
Version: 4.0
Hardware: All
OS: Linux
Target Milestone: ---
: ---
Assignee: Radek Vokal
QA Contact: Ben Levenson
Depends On:
TreeView+ depends on / blocked
Reported: 2006-05-02 08:11 UTC by Peter Riley
Modified: 2007-11-30 22:07 UTC (History)
0 users

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

Attachments (Terms of Use)

Description Peter Riley 2006-05-02 08:11:41 UTC
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)


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

  RHEL 4 U3

How reproducible:


Steps to Reproduce:
1. man 5 ethers
2. man 8 arp
3. vi /etc/ethers ?!?

Comment 1 Peter Riley 2006-05-02 12:16:21 UTC

>  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

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 


Comment 2 Radek Vokal 2006-05-02 12:46:38 UTC
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.