a systemd with a 64-character hostname (the maximum hostname length for Linux) will cause a dhcp server to reject its dhcp lease due to passing the invalid hostname in the dhcp lease request.
this is fixed by commit 9740eae694e93b06658ff3b3045b22b591561e7c which is included in Bionic and later. This is needed only for Xenial.
[other info]
this is a follow on to bug 1862232, which corrected sd-dhcp-client.c to continue networkd dhcp even if the hostname is invalid, however the older code in Xenial doesn't correctly detect the invalid hostname, so this additional patch is needed.
[impact]
a systemd with a 64-character hostname (the maximum hostname length for Linux) will cause a dhcp server to reject its dhcp lease due to passing the invalid hostname in the dhcp lease request.
[test case]
$ cat /etc/systemd/ network/ 10-ens3. network
[Match]
Name=ens3
[Network]
DHCP=yes
set hostname to 64-char name, e.g.:
$ sudo hostnamectl set-hostname a123456789b1234 56789c123456789 d123456789e1234 56789f123456789 g123
restart networkd:
$ sudo systemctl restart systemd-networkd
check logs:
root@a123456789 b123456789c1234 56789d123456789 e123456789f1234 56789g123: ~# journalctl -b -u systemd-networkd --no-pager | grep 'DHCP error' 56789c123456789 d123456789e1234 56789f123456789 g123 systemd- networkd[ 737]: ens3: DHCP error: Client failed: Invalid argument
May 06 19:01:30 a123456789b1234
[scope]
this is fixed by commit 9740eae694e93b0 6658ff3b3045b22 b591561e7c which is included in Bionic and later. This is needed only for Xenial.
[other info]
this is a follow on to bug 1862232, which corrected sd-dhcp-client.c to continue networkd dhcp even if the hostname is invalid, however the older code in Xenial doesn't correctly detect the invalid hostname, so this additional patch is needed.