2.2.x BOOTP bug

From: Andreas Steinmetz (ast@domdv.de)
Date: Mon May 08 2000 - 11:14:01 EST

first things first: please cc me directly as I'm not subscribed to the list.

Problem: nfs rooted Linux 2.2.x (here 2.2.14) with BOOTP support. BOOTP server
is ISC dhcpd v2.0. dhcpd serves the boot path
('option root-path "/my/nfs/root/path";').

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.

4. 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.

--- linux-2.2.14/net/ipv4/ipconfig.c Mon Aug 9 21:04:41 1999
+++ linux-2.2.14-boot/net/ipv4/ipconfig.c Mon May 8 17:43:26 2000
@@ -464,6 +464,12 @@
        *e++ = 17; /* Boot path */
        *e++ = 32;
        e += 32;
+ *e++=57; /* AST: set extension buffer size for reply */
+ *e++=2;
+ *e++=1; /* 128+236+8+20+14, see dhcpd sources */
+ *e++=150; /* AST end */
        *e = 255; /* End of the list */

5. Notes:
   I do believe that this bug does affect only very few people. Still I'm using
   BOOTP floppy kernels for fast installation of new systems and I want to keep
   the whole client network configuration in the dhcpd config file.
   Thus a fix of future kernels would be nice.

Andreas Steinmetz
D.O.M. Datenverarbeitung GmbH

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

This archive was generated by hypermail 2b29 : Mon May 15 2000 - 21:00:11 EST