Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting hostname is adding quotation marks to the DHCP request. #283

Closed
minexn opened this issue Jan 29, 2024 · 4 comments
Closed

Setting hostname is adding quotation marks to the DHCP request. #283

minexn opened this issue Jan 29, 2024 · 4 comments
Labels
bug Something isn't working
Milestone

Comments

@minexn
Copy link

minexn commented Jan 29, 2024

Manually setting the hostname in the DHCP request, and quotation marks are sent to the DHCP server.

DHCP hostname

Config

set dhcp-client client-if eth0
set dhcp-client client-if eth0 option hostname value infix-r2s-1

This can be seen in the udhcpc process.

udhcpc -f -p /run/dhcp-eth0.pid -t 10 -T 3 -A 10 -a1000 -S -R -x hostname:"infix-r2s-1" -i eth0 -V Infix v23.11.0-121-g051658d-dirty

@troglobit
Copy link
Contributor

Nice catch! I'm guessing -x "hostname:infix-r2s-1" would work better, right?

@troglobit troglobit added the bug Something isn't working label Jan 29, 2024
@troglobit troglobit added this to the Infix v24.01 milestone Jan 29, 2024
@minexn
Copy link
Author

minexn commented Jan 29, 2024

Because the hostname doesn't contain spaces, we don't need quotation marks.

RFCs mandate that a hostname's labels may contain only the ASCII letters 'a' through 'z' (case-insensitive), the digits '0' through '9', and the hyphen. Hostname labels cannot begin or end with a hyphen. No other symbols, punctuation characters, or blank spaces are permitted.

udhcpc -f -p /run/dhcp-eth0.pid -t 10 -T 3 -A 10 -a1000 -S -R -x hostname:infix-r2s-1 -i eth0 -V Infix v23.11.0-121-g051658d-dirt

@troglobit
Copy link
Contributor

Because the hostname doesn't contain spaces, we don't need quotation marks.

RFCs mandate that a hostname's labels may contain only the ASCII letters 'a' through 'z' (case-insensitive), the digits '0' through '9', and the hyphen. Hostname labels cannot begin or end with a hyphen. No other symbols, punctuation characters, or blank spaces are permitted.

udhcpc -f -p /run/dhcp-eth0.pid -t 10 -T 3 -A 10 -a1000 -S -R -x hostname:infix-r2s-1 -i eth0 -V Infix v23.11.0-121-g051658d-dirt

Ah, of course! 😃👍

troglobit added a commit that referenced this issue Jan 29, 2024
No need to guard the hostname option in quotes, it must not contain
whitespace.  If user configured more than one word, use first.

Fixes #283

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
troglobit added a commit that referenced this issue Jan 30, 2024
No need to guard the hostname option in quotes, it must not contain
whitespace.  If user configured more than one word, use first.

Fixes #283

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
@wkz wkz closed this as completed in 08cec2e Jan 30, 2024
@minexn
Copy link
Author

minexn commented Jan 31, 2024

Another fantastic fix for infix 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants