From 427928caa4c0f6b2f34f27e801ac42a708ba9692 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 5 Feb 2020 05:41:30 +0100 Subject: [PATCH] network: change "Gateway=dhcp" to "Gateway=_dhcp" (#14774) This way we avoid confusion with a DNS name. Fixes #14773. --- NEWS | 4 ++-- man/systemd.network.xml | 4 ++-- src/network/networkd-route.c | 2 +- test/test-network/conf/dhcp-client-gateway-ipv4.network | 2 +- test/test-network/conf/dhcp-client-gateway-ipv6.network | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index 2724cbaf06..181835a246 100644 --- a/NEWS +++ b/NEWS @@ -148,8 +148,8 @@ CHANGES WITH 245 in spe: with it's sense inverted. * The Gateway= setting of [Route] sections of .network files gained - support for a special new value "dhcp". If set the configured static - route uses the gateway host configured via DHCP. + support for a special new value "_dhcp". If set, the configured + static route uses the gateway host configured via DHCP. * A new User= setting has been implemented for the [RoutingPolicyRule] section of .network files for configuring source routing based on UID diff --git a/man/systemd.network.xml b/man/systemd.network.xml index 1861def7da..9e0bf69a35 100644 --- a/man/systemd.network.xml +++ b/man/systemd.network.xml @@ -1135,8 +1135,8 @@ Gateway= - Takes the gateway address or special value dhcp. If - dhcp, then the gateway address provided by DHCP (or in the IPv6 case, + Takes the gateway address or special value _dhcp. If + _dhcp, then the gateway address provided by DHCP (or in the IPv6 case, provided by IPv6 RA) is used. diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index 2df8b864e8..e924723e5d 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -1006,7 +1006,7 @@ int config_parse_gateway( if (r < 0) return r; - if (streq(rvalue, "dhcp")) { + if (streq(rvalue, "_dhcp")) { n->gateway_from_dhcp = true; TAKE_PTR(n); return 0; diff --git a/test/test-network/conf/dhcp-client-gateway-ipv4.network b/test/test-network/conf/dhcp-client-gateway-ipv4.network index 1b8a3751a4..7e6f6b33e0 100644 --- a/test/test-network/conf/dhcp-client-gateway-ipv4.network +++ b/test/test-network/conf/dhcp-client-gateway-ipv4.network @@ -6,5 +6,5 @@ DHCP=ipv4 IPv6AcceptRA=no [Route] -Gateway=dhcp +Gateway=_dhcp Destination=10.0.0.0/8 diff --git a/test/test-network/conf/dhcp-client-gateway-ipv6.network b/test/test-network/conf/dhcp-client-gateway-ipv6.network index 058cb33080..ce708e7da9 100644 --- a/test/test-network/conf/dhcp-client-gateway-ipv6.network +++ b/test/test-network/conf/dhcp-client-gateway-ipv6.network @@ -5,5 +5,5 @@ Name=veth99 DHCP=ipv6 [Route] -Gateway=dhcp +Gateway=_dhcp Destination=2001:1234:5:9fff:ff:ff:ff:ff/128