>Finally I found the problem:
>"/src/etherboot.h" sets the constant DHCP_OPT_LEN to 312 (=0x138).
>This seems to be the maximal length for _all_ DHCP options together.
>I set it to 512 and encountered no problems with my dhcpd.conf:
>The bootmenu appeared with all entries. For larger dhcpd.confs
>the value has to be increased further.
>
>But the contstant hasn´t been defined just for fun,
>so what purpose does the constant have ? And where
>can I find information about it (e.g. RFC)?
Ok, I took a look at the RFCs and the source. You are right that
DHCP_OPT_LEN is the cause of the problem, but not in the obvious way.
In the DHCPDISCOVER message, Etherboot already requests for the maximum
packet size that can be accomodated in the buffer (1024 if the buffer is
located at 0x93C00, otherwise sizeof(struct bootp_t) + 1024). The
problem is the call to decode_rfc1533, where the decoding of the buffer
is restricted by DHCP_OPT_LEN. There are several possible steps that can
be taken, each with greater consequences:
1. Change the call near line 880 to pass DHCP_OPT_LEN + MAX_BOOTP_EXTLEN
just like the line above, since the options extend into the extension
area anyway. The EXTENSION_PATH option should be taken out of the DHCP
options requested, so that Etherboot does not request it and have the
contents of the file overwrite the extension area. Technically
extension path (option 18) is still legal in DHCPDISCOVER requests. In
practice it doesn't seem to be useful to DHCP because the buffer can be
larger now. ISC dhcpd does not support this option directly, you would
have to request for option-18. The one small problem with this is that
you could not enable DHCP support and then use extension path with an
bootp server. It could be argued that people who use bootp+extension
path should be encouraged to migrate to DHCP.
2. More radically, rework the definitions of bootp_t and bootpd_t. The
former is a definition of the minimal BOOTP/DHCP packet and is used for
defining a DHCPDISCOVER packet in bootp() and so should not be bloated
so we should probably leave bootp_t alone. The latter includes the
extension area or additional options area. But it's not clear to me if
anything needs changing in bootpd_t except that the member
"bootp_extension" wrongly describes what is really the continuation of
the DHCP options area.
3. Put the extension path handling code inside #ifdef NO_DHCP_SUPPORT,
so that not only does enabling DHCP not request the extension path but
it definitely cannot handle it. This would save a little bit of code
space.
If you (shredda) could try fix 1 and confirm this works, we have at
least confirmation of my theory.
|