Documentation bug with dhcp-client-identifier and leading zero byte

Jonah Petri jonah at sense.com
Tue May 26 19:38:36 UTC 2026


Hello,

I spent quite a while chasing what turned out to be a documentation 
issue with the correct use of dhcp-client-identifier.  I wanted to write 
to the list in the hopes that someone in the future could be saved from 
the trouble I went through.T

The documentation correctly states that DHCP clients will prepend a zero 
byte to a ASCII dhcp client identifier.  However, the example given in 
dhcp-options.5 for how to deal with this is wrong and will not work.

The string parser in the config file grammar, implemented in conflex.c 
read_string(), expects 3 digits of octal after the backslash escape, and 
it will ignore any backslash escapes with less than this number of octal 
digits.  So the example "\0foo" will NOT be read as having a leading 
zero byte.  It will instead be read as identical to "foo".  If you want 
to have a leading zero byte, you must spell the string as "\000foo".  
The alternative is to spell out the entire thing in colon-separated 
bytes, like 00:66:6F:6F.  There appears to be hex escape parsing as well 
but since that's not documented anywhere I saw, I won't mention it further.

I would also ask that the docs be updated to reflect the correct usage, 
but I know that the project is EOL and there might be no capacity to do so.

All the best,

Jonah

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20260526/0971b778/attachment.htm>


More information about the dhcp-users mailing list