]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-dhcp-client: anonymize DHCPDISCOVER (fixes #13992)
authorSerge <serge-name@users.noreply.github.com>
Sat, 16 Nov 2019 12:22:35 +0000 (15:22 +0300)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 17 Nov 2019 15:06:01 +0000 (00:06 +0900)
According to RFC7844 section 3 the DHCPDISCOVER message should not contain option 50 («Requested IP Address») when Anonymize is true

src/libsystemd-network/sd-dhcp-client.c

index ef330fe28ebd6bd1213b9551e01909c13a8e7693..f03989a5a7e5182a6b36fb4f4161fbf008478b79 100644 (file)
@@ -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);