Problem/issues with DHCP

Chris Johns chrisj at rtems.org
Fri Feb 20 09:47:19 UTC 2009


Mick Davis wrote:
> 
> Could I have an early look at any DHCP changes please?

I have created PR 1384 to track the issue. A patch for CVS (4.10) is attached 
to the PR. A 4.9 patch would need to revert the bool changes I made.

> I'm debugging 
> through some issues.  I can't seem to follow your description on where 
> the problem is.

I added some text that may help plus a patch.

> 
> I've back ported the small changes in cvs to our 4.7 based software.
> 

Hmm, time to think about an upgrade. :-)

> The first issue I've had is that the DHCP code would not use the replies 
> our router would send.  It was failing in bootpc_call(), when checking 
> the size of the response against the define BOOTP_MIN_LEN, which is 300. 
>  I skimmed the RFCs for this definition, but I don't see it explicitly. 
>  I can only see that all the members of the bootp_packet / dhcp_packet 
> structure are required, except for vend, which is variable length?  The 
> linux server I tried pads to 300 bytes.
> 
> Should BOOTP_MIN_LEN be around 241? That's my rough calculation for a 
> packet without padding.

No idea.

> 
> My next issue was with a minimally configured linux server, when 
> renewing the lease.  The server gives the following settings;
> 
> dhcpc: smc: inet: 10.1.1.114      mask: 255.255.255.0
>              srv: 10.1.1.20         gw: 0.0.0.0
> 
> And I get this error;
> bootpc_adjust_interface: add net route, error=114

You need to track the routes with some debug code. Just call the route print 
routine provided in the stack before, after and during if you need to.

> 
> 114 is ENETUNREACH, I think because the server doesn't provide a gateway 
> address.  That's OK, the error is ignored, but later when the task tries 
> to broadcast a message I get the error
> 
> bootpc_call: sosend: 118
> 

There should be a broadcast route to the network.

> Where the send error is EHOSTUNREACH .  I don't understand this, because 
> broadcast messages were OK before the interface was reconfigured with 
> bootpc_adjust_interface().

If the netmask is not correct or has effected something the broadcast could 
fail. This is just a guess.

> 
> If I use the same settings for a static IP configuration, broadcast 
> messages are sent OK to the local network, eg to 10.255.255.255 .  The 
> configuration of a static IP uses a procedure in rtems_bsdnet_setup() 
> which looks the same as bootpc_adjust_interface().
> 
> I tried the multicast fix in bug 1381, which doesn't seem to help.
> 

That fix look fine to me for the problem it resolves.

Regards
Chris



More information about the users mailing list