Bug 840601 - dhcpd won't listen to alias: Failed to get HW address for eth0:1
dhcpd won't listen to alias: Failed to get HW address for eth0:1
Product: Fedora
Classification: Fedora
Component: dhcp (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jiri Popelka
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-07-16 12:53 EDT by joshua
Modified: 2012-08-06 03:59 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-08-06 03:59:23 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description joshua 2012-07-16 12:53:27 EDT
Description of problem:

Even with a etc/sysconfig/dhcpd with these content:

DHCPDARGS="eth0:1 eth0"

...dhcpd refuses to use the eth0:1 alias:

dhcpd: Listening on LPF/eth0/00:50:56:ba:d4:cf/
dhcpd: Sending on   LPF/eth0/00:50:56:ba:d4:cf/
dhcpd: Failed to get HW address for eth0:1
(dhcpd exits)

This this intended?  It seems to be a known RHEL6 issue:  http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/sect-Configuring_a_Multihomed_DHCP_Server.html

... but does it have to be?  Surely it shouldn't care.

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

Comment 1 Jiri Popelka 2012-07-18 09:53:13 EDT
AFAIK these network aliases (in general) are a relic of linux-2.0 and one should generally avoid them, but yes, dhcpd shouldn't fail to start because of it.
Comment 2 Jiri Popelka 2012-07-18 10:10:09 EDT
Technical description of the problem (mainly for me to not forget):

First we get (using getifaddrs(), AF_INET/AF_INET6 address family) the list of interfaces which have some network-layer (IPv4/IPv6) address configured.
Either from the list the user provided (e.g. DHCPDARGS="eth0:1 eth0")
or from all interfaces on the system.

Then we try to get a link-layer (MAC) address for each of them.
Again we use getifaddrs(), but this time we use only AF_PACKET address family.
Problem is that there's no AF_PACKET for eth0:1, just for eth0 (try the example program from getifaddrs(3)).
Comment 3 Jiri Popelka 2012-07-18 11:09:00 EDT
I haven't any clean solution at the moment. Hopefully I'll get one in future.

I just updated the lpf-ib.patch (which changes the way of getting ll address to getifaddrs() usage).
When we haven't been able to get the ll address for some interface, we check whether it contains colon and if yes (so it's most likely an alias), we strip the part beginning with colon and try again for the rest (most likely the real interface name).
This doesn't work when the alias name doesn't contain colon, but hopefully I'll figure out something cleaner one day.
Comment 4 Jiri Popelka 2012-07-18 11:58:11 EDT
Please try this build
Comment 5 Jiri Popelka 2012-07-18 16:07:54 EDT
Or better this one
Comment 6 Fedora Update System 2012-07-23 08:01:15 EDT
dhcp-4.2.4-6.fc17 has been submitted as an update for Fedora 17.
Comment 7 Jiri Popelka 2012-07-23 08:14:46 EDT
(In reply to comment #3)
> When we haven't been able to get the ll address for some interface ...

I changed the fix.
I added the fall-back method (using ioctl(SIOCGIFHWADDR)) when getting of link-layer address with getifaddrs() fails.
That seems to fix this bug and also bug #626514, comment #62.
Comment 8 Fedora Update System 2012-07-23 16:28:38 EDT
Package dhcp-4.2.4-6.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing dhcp-4.2.4-6.fc17'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
Comment 9 Fedora Update System 2012-07-25 08:45:19 EDT
dhcp-4.2.4-7.P1.fc17 has been submitted as an update for Fedora 17.
Comment 10 Fedora Update System 2012-08-01 14:28:34 EDT
dhcp-4.2.4-9.P1.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

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