NetBSD Problem Report #8703

Received: (qmail 1777 invoked from network); 29 Oct 1999 11:53:44 -0000
Message-Id: <199910290658.XAA01139@quiche-lorraine.mit.edu>
Date: Thu, 28 Oct 1999 23:58:29 -0700 (PDT)
From: root@ihack.net
Reply-To: root@ihack.net
To: gnats-bugs@gnats.netbsd.org
Subject: NFS_BOOT_BOOTP doesn't work
X-Send-Pr-Version: 3.95

>Number:         8703
>Category:       kern
>Synopsis:       NFS_BOOT_BOOTP doesn't work
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    jdolecek
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 29 04:54:00 +0000 1999
>Closed-Date:    Tue Sep 25 19:39:35 +0000 2001
>Last-Modified:  Tue Sep 25 19:39:35 +0000 2001
>Originator:     Charles M. Hannum
>Release:        1999/10/14
>Organization:
	Internetwork Hacker
>Environment:
	i386
System: NetBSD quiche-lorraine.mit.edu 1.4L NetBSD 1.4L (GENERIC-) #5: Fri Oct 29 04:53:03 EDT 1999 mycroft@zygorthian-space-raiders.mit.edu:/u2/src/sys/arch/i386/compile/GENERIC- i386


>Description:
	A kernel configured with NFS_BOOT_BOOTP is unable to mount its
	root file system from the network.  I consistently get:

	nfs_boot: getfh - no pathname

	tcpdump shows that the response from dhcpd to the BOOTP request
	does not, in fact, contain the root path name; thus I suspect
	this may actually be a bug in dhcpd (same vintage as kernel).

	A kernel configured with NFS_BOOT_DHCP boots correctly.

	The relevant stanza from dhcpd.conf is:

        host quiche-lorraine.mit.edu {
                hardware ethernet 00:10:4b:62:ae:3c;
                fixed-address quiche-lorraine.mit.edu;
                option root-path "/u2/export/root/quiche-lorraine";
        }

	And the aforementioned tcpdump output is:

	06:09:31.694376 0:10:4b:62:ae:3c ff:ff:ff:ff:ff:ff 0800 534: 0.0.0.0.68 > 255.255.255.255.67:  [udp sum ok] xid:0x7ffffff vend-rfc1048 [ttl 1] (id 6)
	06:09:31.715642 0:0:f4:d4:15:ef 0:10:4b:62:ae:3c 0800 342: 18.187.1.80.67 > 255.255.255.255.68:  [udp sum ok] xid:0x7ffffff Y:18.187.1.71 S:18.187.1.80 vend-rfc1048 dhpc-srvid:18.187.1.80 SM:255.255.0.0 DG:18.187.0.1 NS:18.70.0.160,18.71.0.151 HN:"quiche-lorraine.mit.edu" if-lsubnet:0 [tos 0x10] (ttl 16, id 0)
	06:09:31.718850 0:10:4b:62:ae:3c ff:ff:ff:ff:ff:ff 0806 60: arp who-has 18.187.1.71 tell 18.187.1.71

>How-To-Repeat:
	Try to boot using NFS_BOOT_BOOTP.

>Fix:
	Not known.
>Release-Note:
>Audit-Trail:

From: Matthias Drochner <drochner@zel459.zel.kfa-juelich.de>
To: root@ihack.net
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: kern/8703: NFS_BOOT_BOOTP doesn't work 
Date: Fri, 29 Oct 1999 17:59:34 +0200

 root@ihack.net said:
 > 	tcpdump shows that the response from dhcpd to the BOOTP request
 > 	does not, in fact, contain the root path name; thus I suspect
 > 	this may actually be a bug in dhcpd (same vintage as kernel). 

 I guess the size of all the options exceeds 64 bytes. Our dhcpd
 does strictly stick to the standard and will not send out more
 than 64 bytes of options to a BOOTP client.
 (In other bootp servers, it has become common to send packets up
 to the size of the incoming one.)
 Other bootp servers warn if options get truncated due to space
 shortage. I didn't check, but if our doesn't, it might be worth
 changing.

 >	A kernel configured with NFS_BOOT_DHCP boots correctly.

 DHCP allows for 312 bytes. This might be enough reason to use it.

 For diskless clients which are not able to dhcp, creative use of
 symlinks helps to keep the rootpath short... Perhaps you can
 leave out some other options too.

 best regards
 Matthias



From: cgd@netbsd.org (Chris G. Demetriou)
To: root@ihack.net
Cc: gnats-bugs@gnats.netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: kern/8703: NFS_BOOT_BOOTP doesn't work
Date: 29 Oct 1999 11:07:53 -0700

 root@ihack.net writes:
 > 	tcpdump shows that the response from dhcpd to the BOOTP request
 > 	does not, in fact, contain the root path name; thus I suspect
 > 	this may actually be a bug in dhcpd (same vintage as kernel).

 I would suspect that it might be a configuration issue.  In
 particular, i note that:

 > 	06:09:31.694376 0:10:4b:62:ae:3c ff:ff:ff:ff:ff:ff 0800 534: 0.0.0.0.68 > 255.255.255.255.67:  [udp sum ok] xid:0x7ffffff vend-rfc1048 [ttl 1] (id 6)
 > 	06:09:31.715642 0:0:f4:d4:15:ef 0:10:4b:62:ae:3c 0800 342: 18.187.1.80.67 > 255.255.255.255.68:  [udp sum ok] xid:0x7ffffff Y:18.187.1.71 S:18.187.1.80 vend-rfc1048 dhpc-srvid:18.187.1.80 SM:255.255.0.0 DG:18.187.0.1 NS:18.70.0.160,18.71.0.151 HN:"qui che-lorraine.mit.edu" if-lsubnet:0 [tos 0x10] (ttl 16, id 0)
 > 	06:09:31.718850 0:10:4b:62:ae:3c ff:ff:ff:ff:ff:ff 0806 60: arp who-has 18.187.1.71 tell 18.187.1.71

 there's a bunch of stuff there.  (vartious tags, hostname, etc.)

 bootp has a much smaller amount of space in the packet available for
 data than dhcp does.  (see the RFCs if you want exact numbers.  8-)

 One of the items that's often squeezed out when there's an overrun is
 the boot path, because it tends to be rather large.  You might try
 severely trimming the information sent to bootp clients.

 There's no real solution, i don't think, but it might be nice if the
 server would issue a diagnostic when it has to truncate reply contents
 like this, too...



 cgd
 -- 
 Chris Demetriou - cgd@netbsd.org - http://www.netbsd.org/People/Pages/cgd.html
 Disclaimer: Not speaking for NetBSD, just expressing my own opinion.

From: Matthias Drochner <M.Drochner@fz-juelich.de>
To: root@ihack.net
Cc: gnats-bugs@gnats.netbsd.org, cgd@netbsd.org, bdc@world.std.com,
        gillhaa@ghost.whirlpool.com, mellon@netbsd.org
Subject: Re: kern/8703: NFS_BOOT_BOOTP doesn't work 
Date: Tue, 09 Nov 1999 16:40:08 +0100

 To deal with the problem (which might be the cause of the
 lossage reported on the port-vax-list) I propose two changes to
 our dhcpd:
 1. Allow options up to the size of the incoming BOOTP packet.
    (This isn't literally the standard, but common practice.)
 2. If an option is dropped due to space shortage, issue a warning.
    (The implementation of the latter is suboptimal - it would be good
    to mention the slave's name or address here, but this information
    is not available at this point afais.)
 Opinions?

 btw - Ted - is there a reason not to upgrade dhcpd to the 2.0 release?
 (besides time, of course)

 best regards
 Matthias


 Index: usr.sbin/dhcp/common/options.c
 ===================================================================
 RCS file: /cvsroot/basesrc/usr.sbin/dhcp/common/options.c,v
 retrieving revision 1.1.1.9
 diff -u -r1.1.1.9 options.c
 --- options.c	1999/03/30 03:10:46	1.1.1.9
 +++ options.c	1999/11/09 15:07:42
 @@ -198,9 +198,11 @@
  	   honor it. */
  	if (mms)
  		main_buffer_size = mms - DHCP_FIXED_LEN;
 -	else if (bootpp)
 -		main_buffer_size = 64;
 -	else
 +	else if (bootpp) {
 +		main_buffer_size = inpacket->packet_length - DHCP_FIXED_LEN;
 +		if (main_buffer_size < 64)
 +			main_buffer_size = 64;
 +	} else
  		main_buffer_size = 576 - DHCP_FIXED_LEN;

  	if (main_buffer_size > sizeof buffer)
 @@ -401,6 +403,8 @@
  			/* If this option is going to overflow the buffer,
  			   skip it. */
  			if (bufix + 2 + incr > buflen) {
 +				warn("buffer too small - option %d dropped",
 +				     code);
  				bufix = optstart;
  				break;
  			}



From: Ted Lemon <mellon@isc.org>
To: M.Drochner@fz-juelich.de
Cc: root@ihack.net, gnats-bugs@gnats.netbsd.org, cgd@netbsd.org,
        bdc@world.std.com, gillhaa@ghost.whirlpool.com
Subject: Re: kern/8703: NFS_BOOT_BOOTP doesn't work 
Date: Tue, 09 Nov 1999 17:20:47 -0500

 > 1. Allow options up to the size of the incoming BOOTP packet.
 >    (This isn't literally the standard, but common practice.)

 This breaks some clients, which is why it's not the default behaviour
 - there's a reason why we follow protocols.  Given that this is a
 problem with the kernel not being able to get the information it needs
 (dunno if this is true) the fix would be to just tweak the kernel to
 send a dhcp-max-message-size option negotiating the size of the return
 packet up to the interface MTU.

 > 2. If an option is dropped due to space shortage, issue a warning.
 >    (The implementation of the latter is suboptimal - it would be good
 >    to mention the slave's name or address here, but this information
 >    is not available at this point afais.)

 This would generate a lot of junk in the logs.

 > btw - Ted - is there a reason not to upgrade dhcpd to the 2.0 release?
 > (besides time, of course)

 No, there's no reason.   2.0 has a feature where you can set the
 maximum message size on the server side rather than the client side,
 too, so you can tweak your configuration file to extend the message
 size rather than breaking protocol compliance with the proposed hack.

 			       _MelloN_

From: Andrew Gillham <gillhaa@ghost.whirlpool.com>
To: mellon@isc.org (Ted Lemon)
Cc: M.Drochner@fz-juelich.de, root@ihack.net, gnats-bugs@gnats.netbsd.org,
        cgd@netbsd.org, bdc@world.std.com
Subject: Re: kern/8703: NFS_BOOT_BOOTP doesn't work
Date: Tue, 9 Nov 1999 23:41:09 -0500 (EST)

 Ted Lemon writes:
 > 
 > This breaks some clients, which is why it's not the default behaviour
 > - there's a reason why we follow protocols.  Given that this is a
 > problem with the kernel not being able to get the information it needs
 > (dunno if this is true) the fix would be to just tweak the kernel to
 > send a dhcp-max-message-size option negotiating the size of the return
 > packet up to the interface MTU.

 How does this relate to BOOTP?  My understanding (and experience) of
 the problem being addressed is that dhcpd fails, and bootpd does
 not.  This may be too general, as the options are perhaps not the
 same. Paring back the options in /etc/dhcpd.conf allows these BOOTP
 clients to work again. 

 Will the dhcpd 2.0 size feature fix this type of thing, or is it for
 a different problem?

 -Andrew
 -- 
 -----------------------------------------------------------------
 Andrew Gillham                            | This space left blank
 gillham@whirlpool.com                     | inadvertently.
 I speak for myself, not for my employer.  | Contact the publisher.

From: Ted Lemon <mellon@isc.org>
To: Andrew Gillham <gillhaa@ghost.whirlpool.com>
Cc: M.Drochner@fz-juelich.de, root@ihack.net, gnats-bugs@gnats.netbsd.org,
        cgd@netbsd.org, bdc@world.std.com
Subject: Re: kern/8703: NFS_BOOT_BOOTP doesn't work 
Date: Thu, 11 Nov 1999 12:24:57 -0500

 > My understanding (and experience) of the problem being addressed is
 > that dhcpd fails, and bootpd does not.

 No, it's bootpd that is failing, and dhcpd that is operating
 correctly.   bootpd is "succeeding" because it's violating the
 protocol.

 There are two ways to work around this.  The first, and, I would say,
 correct way, is to have the kernel set the dhcp-max-message-size
 option to 576, or to the interface MTU.   This prevents you from
 having to tweak the DHCP server configuration to avoid sending options
 you want to send.   While the BOOTP protocol doesn't specify this use
 of the dhcp-max-message-size option, I think it's reasonable.

 > Will the dhcpd 2.0 size feature fix this type of thing, or is it for
 > a different problem?

 The dhcpd-2.0 size feature is another way of doing the same thing, but
 it's kind of lame, because you're basically telling the server to
 violate the protocol.

 Really, the right thing to do is to just use DHCP instead of BOOTP,
 but that's another story... :'}

 			       _MelloN_


From: Andrew Gillham <gillhaa@ghost.whirlpool.com>
To: mellon@isc.org (Ted Lemon)
Cc: M.Drochner@fz-juelich.de, root@ihack.net, gnats-bugs@gnats.netbsd.org,
        cgd@netbsd.org, bdc@world.std.com
Subject: Re: kern/8703: NFS_BOOT_BOOTP doesn't work
Date: Thu, 11 Nov 1999 14:40:54 -0500 (EST)

 Ted Lemon writes:
 > 
 > > My understanding (and experience) of the problem being addressed is
 > > that dhcpd fails, and bootpd does not.
 > 
 > No, it's bootpd that is failing, and dhcpd that is operating
 > correctly.   bootpd is "succeeding" because it's violating the
 > protocol.

 Got it, this makes sense.

 > There are two ways to work around this.  The first, and, I would say,
 > correct way, is to have the kernel set the dhcp-max-message-size
 > option to 576, or to the interface MTU.   This prevents you from
 > having to tweak the DHCP server configuration to avoid sending options
 > you want to send.   While the BOOTP protocol doesn't specify this use
 > of the dhcp-max-message-size option, I think it's reasonable.

 Are we talking about the kernel on the dhcp server?  I'm confused.  Not
 only does BOOTP fail in the kernel (as listed in the PR), but things
 like the Alpha 'netboot' fail with the same issue.  This is why I don't
 think a kernel option on the client will help. :)

 > The dhcpd-2.0 size feature is another way of doing the same thing, but
 > it's kind of lame, because you're basically telling the server to
 > violate the protocol.

 Understood, but if allows machines that "used to work" to work, having
 it available is a good thing.

 > Really, the right thing to do is to just use DHCP instead of BOOTP,
 > but that's another story... :'}
 > 
 > 			       _MelloN_

 And this certainly is an option for the 'netboot' case I mentioned above,
 but not for a similar issue in firmware.

 -Andrew
 -- 
 -----------------------------------------------------------------
 Andrew Gillham                            | This space left blank
 gillham@whirlpool.com                     | inadvertently.
 I speak for myself, not for my employer.  | Contact the publisher.

From: Ted Lemon <mellon@isc.org>
To: Andrew Gillham <gillhaa@ghost.whirlpool.com>
Cc: M.Drochner@fz-juelich.de, root@ihack.net, gnats-bugs@gnats.netbsd.org,
        cgd@netbsd.org, bdc@world.std.com
Subject: Re: kern/8703: NFS_BOOT_BOOTP doesn't work 
Date: Thu, 11 Nov 1999 15:05:46 -0500

 > Are we talking about the kernel on the dhcp server?  I'm confused.  Not
 > only does BOOTP fail in the kernel (as listed in the PR), but things
 > like the Alpha 'netboot' fail with the same issue.  This is why I don't
 > think a kernel option on the client will help. :)

 The kernel.   The alpha netboot program would also have to be
 modified, I guess.   Does the Alpha boot prom also fail?   In that
 case, you're right that the change would have to be made on the DHCP
 server.

 > Understood, but if allows machines that "used to work" to work, having
 > it available is a good thing.

 Yup.

 > And this certainly is an option for the 'netboot' case I mentioned above,
 > but not for a similar issue in firmware.

 Indeed.   :'/

 			       _MelloN_

From: Brian D Chase <bdc@world.std.com>
To: Ted Lemon <mellon@isc.org>
Cc: Andrew Gillham <gillhaa@ghost.whirlpool.com>, M.Drochner@fz-juelich.de,
        root@ihack.net, gnats-bugs@gnats.netbsd.org, cgd@netbsd.org
Subject: Re: kern/8703: NFS_BOOT_BOOTP doesn't work 
Date: Thu, 11 Nov 1999 13:29:59 -0800

 On Thu, 11 Nov 1999, Ted Lemon wrote:

 > > My understanding (and experience) of the problem being addressed is
 > > that dhcpd fails, and bootpd does not.
 > 
 > No, it's bootpd that is failing, and dhcpd that is operating
 > correctly.   bootpd is "succeeding" because it's violating the
 > protocol.

 Ted Lemon is a protocolicly-correct sour puss.

 -brian.
 --- Brian Chase | bdc@world.std.com | http://world.std.com/~bdc/ -----
     Pop a Mentos, for you are on the Path To n'LITE'n'MINT.  -- K.


From: Ted Lemon <mellon@isc.org>
To: Brian D Chase <bdc@world.std.com>
Cc: Andrew Gillham <gillhaa@ghost.whirlpool.com>, M.Drochner@fz-juelich.de,
        root@ihack.net, gnats-bugs@gnats.netbsd.org, cgd@netbsd.org
Subject: Re: kern/8703: NFS_BOOT_BOOTP doesn't work 
Date: Thu, 11 Nov 1999 17:25:57 -0500

 > Ted Lemon is a protocolicly-correct sour puss.

 Daisies are red.

 			       _MelloN_

From: Matthias Drochner <M.Drochner@fz-juelich.de>
To: Ted Lemon <mellon@isc.org>
Cc: Andrew Gillham    <gillhaa@ghost.whirlpool.com>, M.Drochner@fz-juelich.de,
        root@ihack.net, gnats-bugs@gnats.netbsd.org, cgd@netbsd.org,
        bdc@world.std.com
Subject: Re: kern/8703: NFS_BOOT_BOOTP doesn't work 
Date: Fri, 12 Nov 1999 18:27:52 +0100

 mellon@isc.org said:
 > The first, and, I would say, correct way, is to have the kernel set
 > the dhcp-max-message-size option to 576, or to the interface MTU.
 > This prevents you from having to tweak the DHCP server configuration
 > to avoid sending options you want to send.   While the BOOTP protocol
 > doesn't specify this use of the dhcp-max-message-size option, I think
 > it's reasonable. 

 Hmm - dhcpd might be the only BOOTP server which understands this.
 In any case, this doesn't help. The kernel and bootblocks made of
 our sources can be easily DHCP-enabled. Foreign boot code and firmware
 doesn't set this option, and we can't change it.

 > The dhcpd-2.0 size feature is another way of doing the same thing, but
 > it's kind of lame, because you're basically telling the server to
 > violate the protocol. 

 I hope it is per-client? It would be good to have a special option
 value meaning "same as incoming packet size".

 I didn't look closely at 3.0 so far -- does the "conditional
 behaviour" include the ability to choose the set of options
 sent dependent on properties of the incoming packet?
 (The "bootfile name" field would be most convinient as selector.)
 This would solve the problems nicely - the boot PROM would
 get only the absolutely necessary stuff, the kernel perhaps
 some more, and the userland dpcpclient all the "hostname",
 "domain", "nameserver" etc. stuff for final network configuration.

 best regards
 Matthias



From: Ted Lemon <mellon@isc.org>
To: M.Drochner@fz-juelich.de
Cc: Andrew Gillham <gillhaa@ghost.whirlpool.com>, root@ihack.net,
        gnats-bugs@gnats.netbsd.org, cgd@netbsd.org, bdc@world.std.com
Subject: Re: kern/8703: NFS_BOOT_BOOTP doesn't work 
Date: Fri, 12 Nov 1999 12:49:00 -0500

 > I didn't look closely at 3.0 so far -- does the "conditional
 > behaviour" include the ability to choose the set of options
 > sent dependent on properties of the incoming packet?

 Yes, it does.   You can write a statement like:

 	if filename = "fnorch" {
 		option dhcp-max-message-size 576;
 		option root-file-name "10.0.0.2:/var/diskless/fnorch";
 	}

 			       _MelloN_

From: Matthias Drochner <M.Drochner@fz-juelich.de>
To: Ted Lemon <mellon@isc.org>
Cc: M.Drochner@fz-juelich.de, Andrew Gillham    <gillhaa@ghost.whirlpool.com>,
        root@ihack.net, gnats-bugs@gnats.netbsd.org, cgd@netbsd.org,
        bdc@world.std.com
Subject: Re: kern/8703: NFS_BOOT_BOOTP doesn't work 
Date: Fri, 12 Nov 1999 19:06:39 +0100

 mellon@isc.org said:
 > Yes, it does.   You can write a statement like:
 > 	if filename = "fnorch" { 

 VERY GOOD! I'll immediately dump my local hacks and install 3.0!

 best regards
 Matthias



From: Ted Lemon <mellon@isc.org>
To: M.Drochner@fz-juelich.de
Cc: Andrew Gillham <gillhaa@ghost.whirlpool.com>, root@ihack.net,
        gnats-bugs@gnats.netbsd.org, cgd@netbsd.org, bdc@world.std.com
Subject: Re: kern/8703: NFS_BOOT_BOOTP doesn't work 
Date: Fri, 12 Nov 1999 13:17:02 -0500

 I should say that I'm just now committing the code to do "filename",
 so it will be in pl10, not pl9.   pl10 should be out this afternoon -
 sorry for jumping the gun on announcing this... :'}

 			       _MelloN_

From: Ted Lemon <mellon@isc.org>
To: M.Drochner@fz-juelich.de
Cc: Andrew Gillham <gillhaa@ghost.whirlpool.com>, root@ihack.net,
        gnats-bugs@gnats.netbsd.org, cgd@netbsd.org, bdc@world.std.com
Subject: Re: kern/8703: NFS_BOOT_BOOTP doesn't work 
Date: Fri, 12 Nov 1999 17:10:51 -0500

 FYI, pl10 is out and has the filename operator I described in my
 previous email.

 			       _MelloN_
State-Changed-From-To: open->closed 
State-Changed-By: jdolecek 
State-Changed-When: Mon Sep 17 13:03:05 PDT 2001 
State-Changed-Why:  
Use NFS_BOOT_BOOTPARAM. 
State-Changed-From-To: closed->open 
State-Changed-By: jdolecek 
State-Changed-When: Tue Sep 18 11:18:47 PDT 2001 
State-Changed-Why:  
Apparently, I've made a mistake closing this. Reopened. 


Responsible-Changed-From-To: kern-bug-people->jdolecek 
Responsible-Changed-By: jdolecek 
Responsible-Changed-When: Tue Sep 18 11:18:47 PDT 2001 
Responsible-Changed-Why:  
I'd take care of this. 
State-Changed-From-To: open->closed 
State-Changed-By: jdolecek 
State-Changed-When: Tue Sep 25 12:38:39 PDT 2001 
State-Changed-Why:  
I've confirmed NFS_BOOT_BOOTP works okay against -current dhcpd 3.0rc10. 
Thanks for report. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.