statefiles: simplify statefiles_write_state6()
authorDavid Härdeman <[email protected]>
Sat, 8 Nov 2025 17:09:45 +0000 (18:09 +0100)
committerÁlvaro Fernández Rojas <[email protected]>
Tue, 11 Nov 2025 07:31:08 +0000 (08:31 +0100)
commitf6f2ef2de0459ef39baed68aabe2f3266a1a958d
tree31767c72d8fd6bce15e868a91c23d9d25a1e962c
parent940ecbb3916162cf734ffe95e87363199a0c119b
statefiles: simplify statefiles_write_state6()

By collecting the addresses first and writing the hosts entries, we can
write the state line straight to the file, without having to use a
buffer as an intermediary. This also makes the ordering in the function
more logical, as it reflects the order things get written to file.

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