networkd: set dhcp_use_routes to true when dhcp_anonymize is true (#7209)

It does not send duplicated options in the PRL.
Fix #7048.
This commit is contained in:
juga0
2017-11-10 16:03:43 +01:00
committed by Lennart Poettering
parent 9b9881d75b
commit 28522b0d8c
2 changed files with 5 additions and 6 deletions
+2 -2
View File
@@ -632,11 +632,11 @@ int dhcp4_configure(Link *link) {
return r;
}
/* NOTE: when using Anonymity Profiles, routes PRL options are sent
* by default, so they should not be added again here. */
/* NOTE: even if this variable is called "use", it also "sends" PRL
* options, maybe there should be a different configuration variable
* to send or not route options?. */
/* NOTE: when using Anonymize=yes, routes PRL options are sent
* by default, so they don't need to be added here. */
if (link->network->dhcp_use_routes && !link->network->dhcp_anonymize) {
r = sd_dhcp_client_set_request_option(link->dhcp_client,
SD_DHCP_OPTION_STATIC_ROUTE);
+3 -4
View File
@@ -113,9 +113,9 @@ void network_apply_anonymize_if_set(Network *network) {
* (to use the MTU sent by the server but to do not send
* the option in the PRL). */
network->dhcp_use_mtu = false;
/* RFC7844 section 3.6.
* same comments as previous option */
network->dhcp_use_routes = false;
/* NOTE: when Anonymize=yes, the PRL route options are sent by default,
* but this is needed to use them. */
network->dhcp_use_routes = true;
/* RFC7844 section 3.6.
* same comments as previous option */
network->dhcp_use_timezone = false;
@@ -208,7 +208,6 @@ static int network_load_one(Manager *manager, const char *filename) {
network->dhcp_use_ntp = true;
network->dhcp_use_dns = true;
network->dhcp_use_hostname = true;
/* NOTE: this var might be overwriten by network_apply_anonymize_if_set */
network->dhcp_use_routes = true;
/* NOTE: this var might be overwriten by network_apply_anonymize_if_set */
network->dhcp_send_hostname = true;