This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: RedBoot DHCP broken?
> > > > When I build RedBoot with the latest sources, DHCP is not working.
> > > > I get the following output from RedBoot:
> > > >
> > > > ... waiting for BOOTP information
> > > > Invalid DHCP state: 1
> > > > Can't get BOOTP info, using default IP address
> > > >
> > > > All other network operations are working okay.
> > > >
> > > > When I use Ethereal to check the packets sent at boot time, no packets
> > > > are seen from RedBoot at all.
> > > >
> > > > After a quick bit of debugging it seems that in the file
> > > > redboot\current\src\net\bootp.c in the function
> > > > __bootp_find_local_ip()
> > > >
> > > > the function call:
> > > > __udp_send((char *)&b, txSize, &r, IPPORT_BOOTPS, IPPORT_BOOTPC);
> > > > at line 250 is called and returns a value 0, but no packets make it out onto the
> > > > wire. Thus when the subsequent code is waiting for a response, it does not
> > > > get one.
> > > >
> > > > Has anybody else built RedBoot with the latest code and seen/not seen
> > > > this problem?
> > >
> > > No, I've not seen this problem, but I am interested since I [obviously]
> > > broke it for you. A few questions:
> > > * Did it work before?
> >
> > Yes, it did work before.
> >
> > > * Is your server set up for DHCP, or BOOTP only?
> >
> > DHCP only.
> >
> > > * Have you seen the traffic before these changes? [This might just be
> > > a network snoop issue]
> >
> > I had not seen the traffic before - never bothered looking. However, I can see
> > the traffic for operations that currently work (ping and so on).
> >
>
> Is this on the same machine as the DHCP server? If not, you might not
> be able to see that traffic, depending on your network hardware. If you
> are using a network switch, then there may be much traffic that you
> can't actually snoop.
The DHCP server is not the same machine that is running ethereal, and I am
using a switch. But the packet I was expecting was the DHCP discover packet
to IP address to 255.255.255.255 - which should be (and indeed now is) seen.
But I agree that using a switch rather than a hub is not great for debugging
networks.
> > > * Try forcing the network debug code on.
> > > Can you try things with the attached patch? Let me know what you find.
> > >
> >
> > Tried the patch, and it is now working!
>
> Good, but I'm a little confused by it. It may be the case that
> your DHCP server is a bit slow. The change makes the RedBoot
> code more resilient when it has to retry.
FYI, this is the Network traffic I see now it is working:
(Obviously packets are missing because of the switch)
Time Source Dest Type
4.004824 0.0.0.0 255.255.255.255 DHCP_Discover
4.006231 DHCP_Server Broadcast ARP_Who_has_192.168.11.91
5.006438 DHCP_Server 255.255.255.255 DHCP_Offer
5.558438 0.0.0.0 255.255.255.255 DHCP_Request
5.559806 DHCP_Server Broadcast ARP_Who_has_192.168.11.91
6.556531 DHCP_Server 255.255.255.255 DHCP_ACK
It looks to me as if the DHCP server is doing an ARP lookup before
responding to the request - which is taking a long time.
>
> In any case, since it helps I'll commit the changes.
>
That's great, thanks.
> > The output is now:
> >
> > ... waiting for BOOTP information
> > Ethernet eth0: MAC address de:ad:be:ef:00:01
> > IP: 192.168.11.91/255.255.255.0, Gateway: 192.168.11.1
> > Default server: 0.0.0.0, DNS server IP: 0.0.0.0
> >
> > I assume the 'Default server' and 'DNS server IP' values are
> > taken from the config area in FLASH rather than the DHCP
> > server.
>
> The server IP *can* come from the DHCP server, but it may not.
> Some servers don't provide this, others do.
> Currently the DNS IP only comes from 'fconfig'
>
I see.
Cheers,
Chris
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss