Server configuration using conditional evaluation

glenn.satchell at uniq.com.au glenn.satchell at uniq.com.au
Mon Feb 13 04:02:42 UTC 2023


The dhcp-eval man page shows the syntax for switch(), binary-to-ascii() 
and substring(). It's important that you use the right length for the 
substring() so that it can do the binary-to-ascii() correctly. It might 
be that the value from the switch is null or not calculated as you 
expected.

switch (binary-to-ascii(16, 32, ".", substring(option dhcp6.ia-na, 0, 
4)))

Here the substring() is taking the 4 bytes starting at offset 0 - the 
first four bytes.

Then binary-to-ascii is treating that as a 32 bit number and displaying 
it as two 16 bit numbers with a "." in  between. Do you know what the 
dhcp6.ia-na is that is being sent so you can manually confirm the 
function is doing what you expect?

regards,
Glenn

On 2023-02-12 22:47, Darren Ankney wrote:
> The error could start earlier than what you've shown here.  Have a
> look earlier in your file and see if there are missing } or if there
> are unterminated ' or " which would mask your ending }  ATM, I can't
> seem to find man pages for ISC DHCP documenting the use of switch, so
> I'll just assume you've used the correct syntax there.
> 
> On Sat, Feb 11, 2023 at 12:20 PM Thomas Köller
> <thomas at koeller.dyndns.org> wrote:
>> 
>> Am 11.02.23 um 18:09 schrieb Greg Sloop <gregs at sloop.net>:
>> > This config didn't start out as a Windows file with cr lf line endings
>> > did it? (And is still in that format?)
>> 
>> No, definitely not, all line endings ar lf only.
>> --
>> 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
>> dhcp-users at lists.isc.org
>> https://lists.isc.org/mailman/listinfo/dhcp-users


More information about the dhcp-users mailing list