summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-dns.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2024-04-15 07:55:18 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2024-04-20 05:01:53 +0200
commit418f2dc75564330d4ff6c86193f4a3c8ffbb1f1b (patch)
treefd5c406a16c77070ec75618b328002d2861b0e58 /src/network/networkd-dns.c
parenttimedate: handle gracefully if RTC lost time because of power loss (diff)
downloadsystemd-418f2dc75564330d4ff6c86193f4a3c8ffbb1f1b.tar.xz
systemd-418f2dc75564330d4ff6c86193f4a3c8ffbb1f1b.zip
network: introduce network- and protocol-independent default for UseDomains=
Follow-up for fb573007430ab0dbe45517b58837d2fa5cfa1a48. Prompted by #32273.
Diffstat (limited to 'src/network/networkd-dns.c')
-rw-r--r--src/network/networkd-dns.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/network/networkd-dns.c b/src/network/networkd-dns.c
index 150ce62482..7078419d37 100644
--- a/src/network/networkd-dns.c
+++ b/src/network/networkd-dns.c
@@ -31,7 +31,7 @@ UseDomains link_get_use_domains(Link *link, NetworkConfigSource proto) {
case NETWORK_CONFIG_SOURCE_NDISC:
n = link->network->ndisc_use_domains;
c = _USE_DOMAINS_INVALID;
- m = _USE_DOMAINS_INVALID;
+ m = link->manager->ndisc_use_domains;
break;
default:
assert_not_reached();
@@ -45,12 +45,16 @@ UseDomains link_get_use_domains(Link *link, NetworkConfigSource proto) {
if (c >= 0)
return c;
+ /* If per-network but protocol-independent setting is specified, use it. */
+ if (link->network->use_domains >= 0)
+ return link->network->use_domains;
+
/* If global per-protocol setting is specified, use it. */
if (m >= 0)
return m;
- /* Otherwise, defaults to no. */
- return USE_DOMAINS_NO;
+ /* If none of them are specified, use the global protocol-independent value. */
+ return link->manager->use_domains;
}
bool link_get_use_dns(Link *link, NetworkConfigSource proto) {