Re: Documentation clarification about unsigned/signed integer

Simon <[email protected]> Sat, 16 Apr 2022 17:04:57 +0100
Newsgroups gmane.network.dhcp.isc.dhcp-server
Message-ID <[email protected]>
Alex Duzsardi <[email protected]> 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

-- 
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

dhcp-users mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/dhcp-users