dhcpv4: use iovec for forcereconf messages, fix hash
authorDavid Härdeman <[email protected]>
Tue, 7 Oct 2025 04:37:22 +0000 (06:37 +0200)
committerÁlvaro Fernández Rojas <[email protected]>
Tue, 21 Oct 2025 17:05:36 +0000 (19:05 +0200)
commit9653b43617e355c348e39a02a1c431c4219c77c0
treef6fde8e7c6c573909572355aee4457d392a24593
parentbf41f4edfbe30bc3d716aa80bd3370ad1129ce0a
dhcpv4: use iovec for forcereconf messages, fix hash

Do the same iovec conversion for dhcpv4_fr_send(), and remove dhcpv4_put() now
that the last user is gone. Yay.

Note that there was a bug in dhcpv4_fr_send() in that it would first
perform:
md5_hash(&fr_msg, sizeof(fr_msg), &md5);
And later:
sendto(/* fd */, &fr_msg, PACKET_SIZE(&fr_msg, cursor), ...)

But PACKET_SIZE is much smaller than sizeof(fr_msg), meaning that the hash is
not computed for the actual packet that gets sent.

Signed-off-by: David Härdeman <[email protected]>
Link: https://github.com/openwrt/odhcpd/pull/278
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
src/dhcpv4.c