<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">I've found the problem and reported it with explanations to bugs@isc.org.<br>
<br>
Basicaly, the problem is the following:<br>
<br>
When starting dhclient without argument, dhclient ignores the eth0 network card and fails with error "No broadcast interfaces found - exiting".<br>
It's because eth0 at this moment has flag 0x1002. It is down but it is a BROADCAST interface.<br>
<br>
If I strart "dhclient eth0", it correctly get an IP address for eth0.<br>
If I reset the eth0 iface to its previous state (down + IP=0.0.0.0), 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.<br>
<br>
So this is clearly a bug when calling discover_interfaces(DISCOVER_UNCONFIGURED), as it works when are in the discover_interfaces(DISCOVER_RUNNING) case.<br>
<br>
The problem is in file dhcp-4.2.4-P2/common/discover.c:576 (same for 4.2.5)<br>
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).<br>
The code does not check flags to see that the interface is down (thus uncondfigured).<br>
<br>
Another problem is that at this point, we do not have the flags.<br>
<br>
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.....<br>
<br>
I'm unfortunately not enough skilled to fix this, so if one can fix this, that would be cool.<br>
<br>
Best regards,<br>
<br>
<div><br>
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px"><font face="Tahoma">-- <br>
   Olivier LAHAYE<br>
   CEA DRT/LIST/DCSI/DIR</font><br>
</div>
</div>
</div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF779121"><font color="#000000" face="Tahoma" size="2"><b>De :</b> dhcp-users-bounces+olivier.lahaye=cea.fr@lists.isc.org [dhcp-users-bounces+olivier.lahaye=cea.fr@lists.isc.org] de la part de LAHAYE Olivier<br>
<b>Date d'envoi :</b> lundi 18 mars 2013 17:11<br>
<b>À :</b> dhcp-users@lists.isc.org<br>
<b>Objet :</b> [PROVENANCE INTERNET] "No broadcast interfaces found - exiting" despite presence of eth0.<br>
</font><br>
</div>
<div></div>
<div>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt"><br>
Hi,<br>
<br>
I'm facing a wired problem using dhclient.<br>
<br>
I'm creating a specific initrd from scratch (for systemimager deployment software), and I've built dhcp-4.2.4-P2<br>
<div><br>
My initrd is using kernel 3.7.5 and udev-182. I've not used systemd and Networkmanager either.<br>
<br>
When booting, all the hardware is correctly detected, but dhclient fails with the error: "No broadcast interface found - exiting.".<br>
<br>
This is strange because if I type "dhclient eth0", it works.<br>
If I type ifconfig eth0 inet 0.0.0.0; ifconfig eth0 down<br>
and If I setup a buggy address like ifconfig eth0 inet 192.168.1.1<br>
then dhclient without parameter can discover the interface a get an ip from the server......<br>
<br>
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.<br>
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.<br>
<br>
I can't setup a debug environment into my initrd (gdb+code +...) and it's very hard to debug.<br>
<br>
Looking into common/discover.c, I see no reason why my interface could be ignored.<br>
<br>
- 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?<br>
I have (all rw):<br>
/run (tmpfs)<br>
/var/run (link to /run)<br>
/tmp/ (devpts)<br>
/dev (devtmpfs)<br>
/dev/pts (<br>
/sys (sysfs)<br>
/proc (profs)<br>
/var/db/<br>
/var/log (tmpfs)<br>
- Or maybe a bad option is setup in my kernel? If yes which one?<br>
- Or maybe a bad option in udevd compilation? a missing script?<br>
- 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".<br>
<br>
Any ideas what could prevent dhclient to ignore eth0 if not specified on the command line and if ip is set to 0.0.0.0?<br>
<br>
Many thanks for any advices<br>
<br>
Best regards.<br>
<br>
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
 0.0.0.0 that the dhclient fails to discover interfaces.....<br>
<br>
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px"><font face="Tahoma">-- <br>
   Olivier LAHAYE<br>
   CEA DRT/LIST/DCSI/DIR</font><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>