[ipxe-devel] Option user-class violates RFC 3004.

Christian Nilsson nikize at gmail.com
Wed Oct 24 19:53:26 UTC 2018


On Wed, 24 Oct 2018 at 21:42, Mats Erik Andersson <bsd at gisladisker.se> wrote:
>
> Hello there,
>
> in the source file 'src/net/udp/dhcp.c', line 90,
> the user class option is implemented to produce
>
>     77, 4, 'i', 'P', 'X', 'E'
>
> which is in violation of RFC 3004, page 3. The option
> in question is an opaque construct intending the possi-
> bility of multiple suboptions, usually called instances.
> Your code does not specify the total length of the pay-
> load, it only states the length of the first and only
> instance "iPXE". The correct form is thus
>
>     77, 5, 4, 'i', 'P', 'X', 'E'
>
> The tcpdump of OpenSolaris' origin does not recognize
> the error, but tcpdump from any *BSD or GNU/Linux will
> show a recoverable error in instance #1.
>

Hej,
There already is documentation regarding this, please see
https://ipxe.org/cfg/user-class#notes
Unformated version:

RFC 3004 defines the DHCP user class as a set of length-value tuples,
but iPXE treats it as a string.1) You can choose to manually construct
a value which conforms to RFC 3004 using the set command. For example:

  # Length 4, value 'i' (0x69), 'P' (0x50), 'X' (0x48), 'E' (0x45)
  set user-class:hex 04:69:50:48:45

1) This is a long-standing bug both in iPXE and in the reference DHCP
server implementation (ISC dhcpd). There is a substantial amount of
documentation which suggests checking option 77 for the value “iPXE”
to identify iPXE clients, and using “set user-class <text>” to specify
a custom user class. To avoid breaking existing setups, iPXE will
continue to provide option 77 as a plain string for DHCPv4.



More information about the ipxe-devel mailing list