diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-01-25 22:27:01 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-01-26 14:42:04 +0100 |
commit | b2a81c0b524fee0a1713720462b6db5c302c3933 (patch) | |
tree | a28283ab8ff6d682e279934780bb601a7967baf5 /src/network/networkd-manager.c | |
parent | 27cb34f57458758ee8615d72c6a60a39d4b92226 (diff) |
networkd: optinally use DHCP lease domain info for routing only
This changes the UseDomains= setting of .network files to take an optional third value "route", in addition to the
boolean values. If set, the passed domain information is used for routing rules only, but not for the search path
logic.
Diffstat (limited to 'src/network/networkd-manager.c')
-rw-r--r-- | src/network/networkd-manager.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c index 0701dd02dd..723a92b5b8 100644 --- a/src/network/networkd-manager.c +++ b/src/network/networkd-manager.c @@ -916,12 +916,17 @@ static int manager_save(Manager *m) { return r; } - if (link->network->dhcp_use_domains) { + if (link->network->dhcp_use_domains != DHCP_USE_DOMAINS_NO) { const char *domainname; r = sd_dhcp_lease_get_domainname(link->dhcp_lease, &domainname); if (r >= 0) { - r = ordered_set_put_strdup(search_domains, domainname); + + if (link->network->dhcp_use_domains == DHCP_USE_DOMAINS_YES) + r = ordered_set_put_strdup(search_domains, domainname); + else + r = ordered_set_put_strdup(route_domains, domainname); + if (r < 0) return r; } else if (r != -ENODATA) |