Page MenuHomeVyOS Platform

DHCP-server bootfile-name double slash syntax weird behaviour
Closed, ResolvedPublicBUG

Description

Hello,
I think I observe this from the old days, probably from VyOS 1.2. This is also present in VyOS 1.3. and 1.4.

I have this setting in the config related to DHCP server:

vyos@router# show service dhcp-server shared-network-name LAN subnet 192.168.XXX.0/24 
 bootfile-name boot\x86\wdsnbp.com

As expected this translates to:

/run/dhcp-server/dhcpd.conf:75:        option bootfile-name "boot\\x86\\wdsnbp.com";
/run/dhcp-server/dhcpd.conf:76:        filename "boot\\x86\\wdsnbp.com";

If you reboot the router, you will get the following setting in the config:

vyos@router# show service dhcp-server shared-network-name LAN subnet 192.168.XXX.0/24 
 bootfile-name boot\\x86\\wdsnbp.com

and this further translates to

/run/dhcp-server/dhcpd.conf:75:        option bootfile-name "boot\\\\x86\\\\wdsnbp.com";
/run/dhcp-server/dhcpd.conf:76:        filename "boot\\\\x86\\\\wdsnbp.com";

Each next reboot doubles the number of backslashes.

This is weird.
Network boot doesn't work in the network with such a setting with multiple backslashes. Each time I manually return the number of slashes to normal, and then commit. Network boot starts working again.

Does anybody else observe this behavior?

Details

Difficulty level
Unknown (require assessment)
Version
1.4
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Unspecified (please specify)

Event Timeline

Is "\" really a valid path for bootfile?

Shouldnt that read "/" instead?

My guess is that some method is handling that line not AS-IS but it gets transformed somewhere along the road.

For example \x123 in a string is a way to define "here I want the char using hexvalue 123" aka escaping the wanted character.

Looking at RFC 2132 https://datatracker.ietf.org/doc/html/rfc2132#section-9.5 there is not much info about allowed characters for option 67 aka bootfile. Only that the minimum allowed length is 1.

The RFC 5970 for DHCP6 have more info:

https://datatracker.ietf.org/doc/html/rfc5970#section-3.2

That above points to RFC 3629 https://datatracker.ietf.org/doc/html/rfc3629 regarding allowed characters for the string.

@Apachez

Yes, boot\x86\wdsnbp.com is a proper filename, and this further correctly translates to double backslash in the dhcp.conf file at /run/dhcp-server/dhcpd.conf, as I noted. Why it is so, explained for example here: https://www.linkedin.com/pulse/quit-thinking-look-matthew-topper
And with such a setting network boot works just fine.
The problem is that after each reboot the vyos configuration scripts, I guess, double the number of backslashes in the config, that further leads to doubling them in the dhcp.conf. And on, and on. This actually breaks the network boot, and manual intervention is required after each router reboot.

There is the task for the bug with "backslashes" T5996

Viacheslav changed the task status from Open to Known issue.Mar 6 2024, 1:06 PM
Viacheslav triaged this task as Normal priority.

The fix for values containing single backslashes has been merged for 1.5 in
https://github.com/vyos/vyos1x-config/pull/23
https://github.com/vyos/vyos-1x/pull/3035

However, it will not be backported to 1.4 yet.

The fix mentioned above has been backported to 1.4: T5996.