]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/libsystemd-network/sd-dhcp6-client.c
sd-dhcp6-client: allow to build large packet 24867/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 29 Sep 2022 18:37:02 +0000 (03:37 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 2 Oct 2022 14:05:05 +0000 (23:05 +0900)
commit9d2d346aaeda53c3dc0c4b3077ec2e39fdfa61c4
tree1061b0a43496b1108d19527b08e74a905f566547
parent045422384093b97d21ae6296bd651555d9eeebea
sd-dhcp6-client: allow to build large packet

Previously, the maximum packet size was hardcoded with 512 + size of
the DHCP header. This makes the packet size increased when necessary.
See option_append_hdr().

Previously, all functions which append DHCP options took the head of the
unused area of the packet, and the size of the free area.
However, with this change, the buffer for the whole packet may be
reallocated, hence now they take the head of the packet and the offset
to the free area.

Fixes #24851.
src/libsystemd-network/dhcp6-option.c
src/libsystemd-network/dhcp6-option.h
src/libsystemd-network/sd-dhcp6-client.c
src/libsystemd-network/test-dhcp6-client.c