Problem/issues with DHCP

Arnout Vandecappelle arnout at mind.be
Sat Nov 8 19:12:29 UTC 2008


On Friday 07 November 2008 00:22:45 Chris Johns wrote:
> >  Ah yes, I encountered a similar problem when I implemented _failsafe().
> >  The issue was with the netmask, or rather the broadcast address.  Before
> > configuring an address, IP will be 0.0.0.0, netmask 0.0.0.0 and broadcast
> > 255.255.255.255.  However, after an address is configured, if you set it
> > back to 0.0.0.0, the networking code will set the netmask to 255.0.0.0
> > and therefore the broadcast address to 255.255.255.0.  I did still see
                                           ^^^^^^^^^^^^^ 0.255.255.255, of 
course
> > DISCOVERs coming out of the DHCP client, but they weren't forwarded by
> > the switch and never arrived at the DHCP server.
>
> Are you saying the 'bootpc_fakeup_interface' fails to set the netmask to
> 0.0.0.0 as it is documented in that code it wants to ?

 To be honest, I don't remember exactly.  I never really checked if the 
netmask or broadcast address were set correctly; I just noticed that even 
after setting netmask to 0.0.0.0 and broadcast to 255.255.255.255, broadcast 
packets were sent to 0.255.255.255...


> > I then dived into the networking code (which is copied from FreeBSD)...
> > and shied away in horror.  In the end, I just implemented a quick fix in
> > the FreeBSD-derived part of the code that detects the address 0.0.0.0 and
> > sets netmask to 0.0.0.0 in that case.  I never submitted that patch
> > because it was in the FreeBSD code which isn't supposed to be touched,
> > and I'm not 100% sure it's the right thing to do.  It does work for me,
> > though.  I've attached the patch now.
>
> I do not think this patch should be accepted because it changes the stack's
> behaviour in a way that might break other code.

 I tend to agree, that's why I never submitted it.  Still, in all cases I can 
imagine where you set the IP address to 0.0.0.0, I think you'd set netmask to 
0.0.0.0 and broadcast to 255.255.255.255 anyway.


 If you have a better patch, I'd be glad to use it!

 Regards,
 Arnout
-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  D206 D44B 5155 DF98 550D  3F2A 2213 88AA A1C7 C933



More information about the users mailing list