diff options
author | Serge <serge-name@users.noreply.github.com> | 2019-11-16 13:22:35 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-11-17 16:06:01 +0100 |
commit | bf9012bbf6d8c8828357a8479080339a2b6b5451 (patch) | |
tree | b275114cdfe821357166f5c2a6be6b1bfe37eade /src/libsystemd-network/sd-dhcp-client.c | |
parent | Error, rather than warn, if failing to start DHCP server (diff) | |
download | systemd-bf9012bbf6d8c8828357a8479080339a2b6b5451.tar.xz systemd-bf9012bbf6d8c8828357a8479080339a2b6b5451.zip |
sd-dhcp-client: anonymize DHCPDISCOVER (fixes #13992)
According to RFC7844 section 3 the DHCPDISCOVER message should not contain option 50 («Requested IP Address») when Anonymize is true
Diffstat (limited to 'src/libsystemd-network/sd-dhcp-client.c')
-rw-r--r-- | src/libsystemd-network/sd-dhcp-client.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c index ef330fe28e..f03989a5a7 100644 --- a/src/libsystemd-network/sd-dhcp-client.c +++ b/src/libsystemd-network/sd-dhcp-client.c @@ -875,7 +875,9 @@ static int client_send_discover(sd_dhcp_client *client) { address be assigned, and may include the ’IP address lease time’ option to suggest the lease time it would like. */ - if (client->last_addr != INADDR_ANY) { + /* RFC7844 section 3: + SHOULD NOT contain any other option. */ + if (!client->anonymize && client->last_addr != INADDR_ANY) { r = dhcp_option_append(&discover->dhcp, optlen, &optoffset, 0, SD_DHCP_OPTION_REQUESTED_IP_ADDRESS, 4, &client->last_addr); |