"No broadcast interfaces found - exiting" despite presence of eth0.

LAHAYE Olivier olivier.lahaye at cea.fr
Wed Mar 20 09:12:35 UTC 2013

I've found the problem and reported it with explanations to bugs at isc.org.

Basicaly, the problem is the following:

When starting dhclient without argument, dhclient ignores the eth0 network card and fails with error "No broadcast interfaces found - exiting".
It's because eth0 at this moment has flag 0x1002. It is down but it is a BROADCAST interface.

If I strart "dhclient eth0", it correctly get an IP address for eth0.
If I reset the eth0 iface to its previous state (down + IP=, and If I assign a non null IP address (a random non null address), dhclient without specifying the interface on the command line will succeed.

So this is clearly a bug when calling discover_interfaces(DISCOVER_UNCONFIGURED), as it works when are in the discover_interfaces(DISCOVER_RUNNING) case.

The problem is in file dhcp-4.2.4-P2/common/discover.c:576 (same for 4.2.5)
If the ioctl trying to get the IP address of the network card fails (needed to check if there is already a lease maybe?), then it is skipped (continue statement).
The code does not check flags to see that the interface is down (thus uncondfigured).

Another problem is that at this point, we do not have the flags.

I've tested to move the flags retreival code before the get address section, and replace the continue with a return. This partially work. The interface is not ignored anymore, unfortunately, later on, line 1003, when testing info.addr.ss_family, the value is uninitialized, and the interface is not configured.....

I'm unfortunately not enough skilled to fix this, so if one can fix this, that would be cool.

Best regards,

   Olivier LAHAYE
De : dhcp-users-bounces+olivier.lahaye=cea.fr at lists.isc.org [dhcp-users-bounces+olivier.lahaye=cea.fr at lists.isc.org] de la part de LAHAYE Olivier
Date d'envoi : lundi 18 mars 2013 17:11
À : dhcp-users at lists.isc.org
Objet : [PROVENANCE INTERNET] "No broadcast interfaces found - exiting" despite presence of eth0.


I'm facing a wired problem using dhclient.

I'm creating a specific initrd from scratch (for systemimager deployment software), and I've built dhcp-4.2.4-P2

My initrd is using kernel 3.7.5 and udev-182. I've not used systemd and Networkmanager either.

When booting, all the hardware is correctly detected, but dhclient fails with the error: "No broadcast interface found - exiting.".

This is strange because if I type "dhclient eth0", it works.
If I type ifconfig eth0 inet; ifconfig eth0 down
and If I setup a buggy address like ifconfig eth0 inet
then dhclient without parameter can discover the interface a get an ip from the server......

More over, if I look at /sys/class/net/eth0/flags, it is 1002 (or 1003 if up), thus it is a BROADCAST able interface.
If I copy the binay of dhclient to a "normal" host, it correctly detects the broadcast interfaces. So I'm sure that the problems does not comes from the dhclient code, but from the environment it is running in.

I can't setup a debug environment into my initrd (gdb+code +...) and it's very hard to debug.

Looking into common/discover.c, I see no reason why my interface could be ignored.

- Maybe a filesystem is not mounted and the socket fails to be created and thus no interface are listed? If yes, what mountpoint of path could be missing?
I have (all rw):
/run (tmpfs)
/var/run (link to /run)
/tmp/ (devpts)
/dev (devtmpfs)
/dev/pts (
/sys (sysfs)
/proc (profs)
/var/log (tmpfs)
- Or maybe a bad option is setup in my kernel? If yes which one?
- Or maybe a bad option in udevd compilation? a missing script?
- my /sbin/dhclient-script seems correct and my /etc/dhcp/dhclient-exit-hoots is also correct as I can retreive all parameters when issuing "dhclient eth0".

Any ideas what could prevent dhclient to ignore eth0 if not specified on the command line and if ip is set to

Many thanks for any advices

Best regards.

PS: I'm running inside a vmware client and the dhcpd on the host is not running (I'm using a dhcpd from centos on another vm). The dhcpd is correctly set up as dhclient eth0 on the client works. It's only when I don't specify the interface and when the ip is that the dhclient fails to discover interfaces.....

   Olivier LAHAYE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20130320/081b38c1/attachment.html>

More information about the dhcp-users mailing list