Page MenuHomePhabricator

hostfile-update missing line feed
Open, Requires assessmentPublicBUG

Description

If we have configured DHCP server with hostfile-update option, first record client won't work, because added line have next view

# From DHCP and "system static host-mapping"100.64.255.101	 ubuntu	 #on-dhcp-event 0:c:29:e3:86:1d

Reproducing

set service dhcp-server hostfile-update
set service dhcp-server shared-network-name dhcpexample authoritative
set service dhcp-server shared-network-name dhcpexample subnet 100.64.255.0/24 default-router '100.64.255.2'
set service dhcp-server shared-network-name dhcpexample subnet 100.64.255.0/24 dns-server '1.1.1.1'
set service dhcp-server shared-network-name dhcpexample subnet 100.64.255.0/24 lease '86400'
set service dhcp-server shared-network-name dhcpexample subnet 100.64.255.0/24 range 0 start '100.64.255.100'
set service dhcp-server shared-network-name dhcpexample subnet 100.64.255.0/24 range 0 stop '100.64.255.199'

Details

Difficulty level
Normal (likely a few hours)
Version
1.2-rolling-201909220118
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible

Event Timeline

Dmitry created this task.Sep 23 2019, 2:03 PM

Also exist additional issue, if we add system static host-mapping all dhcp records will be erased.

vyos@vyos-rtr01# sudo cat /etc/hosts
...
# From DHCP and "system static host-mapping"
100.64.255.102	 ubuntu	 #on-dhcp-event 0:c:29:e3:86:1d

add static-mapping record

vyos@vyos-rtr01# set system static-host-mapping host-name Test01 inet 100.64.255.120
vyos@vyos-rtr01# commit
vyos@vyos-rtr01# sudo cat /etc/hosts
...
# From DHCP and "system static host-mapping"
100.64.255.120	Test01
Dmitry changed Difficulty level from Easy (less than an hour) to Normal (likely a few hours).Sep 23 2019, 2:49 PM
Dmitry claimed this task.Sep 24 2019, 4:09 PM

PR https://github.com/vyos/vyos-1x/pull/137, using vyos-hostsd-client instead of typical adding record to /etc/hosts

pasik added a subscriber: pasik.Sep 25 2019, 7:30 PM
pvelati added a subscriber: pvelati.Oct 1 2019, 8:44 PM