This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Re: Recent RedBoot/BOOTP change


On Tue, 2003-07-15 at 12:38, Gary Thomas wrote:
> On Tue, 2003-07-15 at 12:02, Jonathan Larmour wrote:
> > Gary Thomas wrote:
> > > Jonathan,
> > > 
> > > The change you recently made to BOOTP in RedBoot 
> > > (redboot/current/src/net/bootp.c version 1.10) has broken
> > > BOOTP - at least when using the stock DHCP server from
> > > Red Hat (8.0 and newer).
> > > 
> > > I think we should revert this change, or find out why it was 
> > > made and what the differences are between different servers, etc.
> > 
> > Hmm... I verified that change against the RFCs: 
> > http://www.faqs.org/rfcs/rfc2132.html section 9.6. Clearly it is correct 
> > (52 is option overload which is N/A for a client request and so should be 
> > ignored by a server) so perhaps there is something else going on or indeed 
> > servers out there are broken (although this seems unlikely). Assuming the 
> > option is required at all for some reason - I haven't looked at what's 
> > required for DHCP gatewaying.
> 
> It's obvious now that this option is being used just to make the
> request look like a DHCP request - by specifying an innocuous option.
> When the code 53 (which is supposed to indicate a DHCP request) is
> used, at least the Red Hat servers balk.
> 
> Since it works with the old value (at least on some servers) and maybe
> needs the new value for some others (aren't standards great?), perhaps
> we should try both in the order old-way(52) new-way(53) in hopes that
> one way or the other succeeds.
> 

Ignore everything I said - I think the change was just wrong.
If you look at it, the code now says "I'd like to request
address 0.0.0.0, please" - because it's using the DHCP_REQUEST
code.  Actually, it should be using DHCP_DISCOVER which says
"please provide me with an address".

This fixes it, at least on my RedHat servers:
        Index: redboot/current/src/net/bootp.c
        ===================================================================
        RCS file: /misc/cvsfiles/ecos/packages/redboot/current/src/net/bootp.c,v
        retrieving revision 1.10
        diff -u -5 -p -r1.10 bootp.c
        --- redboot/current/src/net/bootp.c     23 Jun 2003 23:42:15 -0000      1.10
        +++ redboot/current/src/net/bootp.c     15 Jul 2003 18:43:43 -0000
        @@ -68,11 +68,11 @@ extern int net_debug;
         static bootp_header_t *bp_info;
           
         #ifdef CYGSEM_REDBOOT_NETWORKING_USE_GATEWAY
         static const unsigned char dhcpCookie[] = {99,130,83,99};
         static const unsigned char dhcpEndOption[] = {255};
        -static const unsigned char dhcpRequestOption[] = {53,1,3};
        +static const unsigned char dhcpRequestOption[] = {53,1,1};
         #endif
         
         static void
         bootp_handler(udp_socket_t *skt, char *buf, int len,
                      ip_route_t *src_route, word src_port)
        
I'm going to commit this change, unless there is major outcry.

-- 
Gary Thomas <gary@chez-thomas.org>


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]