Documentation clarification about unsigned/signed integer

Simon dhcp1 at thehobsons.co.uk
Sat Apr 16 16:04:57 UTC 2022


Alex Duzsardi <alex.duzsardi at prodigy-it-solutions.com> wrote:

> So basically the server just decodes bytes in whatever format they might be provided be it integer, hex, text and it expects the decoded data to make sense for the type of the option set, integer in the case of option code 93

Indeed. Though in practical terms, internally everything is binary and all config options will be converted to binary for use in comparisons.

> Is this behavior the same for other option types  (string,ip-address,text,flag) ?

As far as I know, yes.


> Guessing providing an integer for a string type option doesn't really make sense , will the server ignore the option in this case or just crash or log an error ?  (i'll test it on a lab server later)

I think it’ll just convert whatever you provide into a binary value internally. The option type is more to do with how it is packed into the packet, and the size.

You can even do mixed types - have a look in the leases file and you see things like client-IDs saved as text items, but with non-printable characters hex encoded.

Simon



More information about the dhcp-users mailing list