lkml.org 
[lkml]   [2001]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] BOOTP extension buffer size (2.4.13pre6)
This patch adds the extension buffer size to the BOOTP request. If not given
the BOOTP server will assume a default of 64 bytes which is quite often too
short, resulting in missing BOOTP data and thus boot failure.

Example (ISC dhcpd):

subnet 10.4.1.0 netmask 255.255.255.0 {
range dynamic-bootp 10.4.1.128 10.4.1.254;
option routers 10.4.1.1;
option broadcast-address 10.4.1.255;
option domain-name-servers 10.4.1.1;
option netbios-name-servers 10.4.1.1;
option time-servers 10.4.1.1;
option ntp-servers 10.4.1.1;
option subnet-mask 255.255.255.0;
option domain-name "lan.domdv.de";
option netbios-dd-server 10.4.1.1;
option netbios-node-type 8;
option ip-forwarding off;
max-lease-time 600;
default-lease-time 120;
dynamic-bootp-lease-length 3600;
next-server 10.1.2.5;
option root-path "/mnt/data4/nfsroot";
}

Stand-alone booted kernel from floppy without the patch does the following:

1. Kernel sends BOOTP request without DHCP MAX MESSAGE SIZE option, but a 128
byte option buffer.

2. dhcpd thus allocates by default a 64 bytes options buffer for the reply,
as this buffer is too small the boot path is not included in the reply
(the domain name and other options already fill the buffer).

3. Kernel doesn't find boot path in BOOTP reply, tries default path and fails
to boot.


Fix: Add the DHCP MAX MESSAGE SIZE option to the dhcp request. The size
in the fix below is 128 bytes linux vendor buffer plus the size dhcpd
subtracts from this size to calculate the vendor buffer size.

<rant>
Posted this patch for 2.2.14 on 08 May 2000. Maybe this time somebody does take
care and applies the patch.
</rant>


Andreas Steinmetz
D.O.M. Datenverarbeitung GmbH
--- linux/net/ipv4/ipconfig.c Tue Oct 23 12:58:28 2001
+++ linux-fixed/net/ipv4/ipconfig.c Tue Oct 23 13:09:53 2001
@@ -605,6 +605,12 @@
*e++ = 17; /* Boot path */
*e++ = 40;
e += 40;
+
+ *e++ = 57; /* set extension buffer size for reply */
+ *e++ = 2;
+ *e++ = 1; /* 128+236+8+20+14, see dhcpd sources */
+ *e++ = 150;
+
*e++ = 255; /* End of the list */
}
\
 
 \ /
  Last update: 2005-03-22 13:10    [W:0.467 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site