sd-dhcp6-lease: ignore invalid byte(s) at the end of the packet
authorPhilipp Kern <phil@philkern.de>
Fri, 23 Jun 2023 08:39:52 +0000 (10:39 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 29 Jun 2023 16:21:25 +0000 (01:21 +0900)
commit81b7335912ce901c61b923218bcdf06a4fdcea07
treeefc093ec92762bde29485c6159d750ced2b067a7
parent49bf8bd57a1c44583cfbc5e68a8b43b59f2f9eca
sd-dhcp6-lease: ignore invalid byte(s) at the end of the packet

Oracle Cloud sends malformed DHCPv6 replies that have an invalid
byte at the end, which cannot be parsed as an option code.

networkd currently can cope with the invalid option (it is ignored),
but the whole packet is ignored altogether because of the additional
null at the end.

It's better to be liberal in what we accept and actually assign an
address, given that the reply contains a valid IA_NA.

Fixes #28183.
src/libsystemd-network/sd-dhcp6-lease.c