diff options
author | juga0 <juga@riseup.net> | 2017-08-04 03:08:41 +0200 |
---|---|---|
committer | juga0 <juga@riseup.net> | 2017-09-06 19:25:41 +0200 |
commit | 1b41b8159980934952adfe862f296793abfe2519 (patch) | |
tree | 1734cd1949b396fd04fb55399b2d3c05db92377f /src/libsystemd-network/sd-dhcp-client.c | |
parent | 5e77a1468e9388847c3a31f84725808aa0df63af (diff) | |
download | systemd-1b41b8159980934952adfe862f296793abfe2519.tar.gz |
networkd: RFC7844, do not set any other option
when Anonymize is enabled.
Use the Client variable to know whether it is enabled.
Diffstat (limited to 'src/libsystemd-network/sd-dhcp-client.c')
-rw-r--r-- | src/libsystemd-network/sd-dhcp-client.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c index b5f85399ad..11e66fae9a 100644 --- a/src/libsystemd-network/sd-dhcp-client.c +++ b/src/libsystemd-network/sd-dhcp-client.c @@ -650,12 +650,16 @@ static int client_message_init( Maximum DHCP Message Size option is the total maximum packet size, including IP and UDP headers.) */ - max_size = htobe16(size); - r = dhcp_option_append(&packet->dhcp, client->mtu, &optoffset, 0, - SD_DHCP_OPTION_MAXIMUM_MESSAGE_SIZE, - 2, &max_size); - if (r < 0) - return r; + /* RFC7844 section 3: + SHOULD NOT contain any other option. */ + if (!client->anonymize) { + max_size = htobe16(size); + r = dhcp_option_append(&packet->dhcp, client->mtu, &optoffset, 0, + SD_DHCP_OPTION_MAXIMUM_MESSAGE_SIZE, + 2, &max_size); + if (r < 0) + return r; + } *_optlen = optlen; *_optoffset = optoffset; |