sd-dhcp-lease: fix reading unaligned memory
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 30 Jan 2022 20:04:52 +0000 (05:04 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 1 Feb 2022 03:23:55 +0000 (12:23 +0900)
commit7b868543072bb9073174a4ae46032fdb6eb24c92
treeb0f09536ee0d890fb3e8f0483c1e5733e2860e6a
parent156d01b9ca4cb6d7b3877a3db7d20ed600dc40c0
sd-dhcp-lease: fix reading unaligned memory

The destination address was read twice, one is for prefixlen, and
other is for destination address itself. And for prefixlen, the address
might be read from unaligned buffer.

This also modernizes the code.
src/libsystemd-network/sd-dhcp-lease.c