mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-14 08:40:33 +01:00
dhcp: accept IPv4-address options longer than expected
Some DHCP servers send duplicate options, and we concatenate them
according to RFC 3396 section 7. Therefore, it's possible that a
option carrying a IPv4 address has a length > 4.
See also commit 1cbf9d22a5 ('n-dhcp4: accept options that are longer
than requested') which did something similar in the nettools client.
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/848
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1034
This commit is contained in:
parent
9a76b07f74
commit
7f8c8078a1
1 changed files with 5 additions and 1 deletions
|
|
@ -1010,7 +1010,11 @@ nm_dhcp_lease_data_parse_in_addr(const guint8 *data, gsize n_data, in_addr_t *ou
|
|||
* - option 28, https://tools.ietf.org/html/rfc2132#section-5.3
|
||||
*/
|
||||
|
||||
if (n_data != 4)
|
||||
/* Some DHCP servers send duplicate options, and we concatenate them
|
||||
* according to RFC 3396 section 7. Therefore, it's possible that a
|
||||
* option carrying a IPv4 address has a length > 4.
|
||||
*/
|
||||
if (n_data < 4)
|
||||
return FALSE;
|
||||
|
||||
*out_val = unaligned_read_ne32(data);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue