From: Zbigniew Jędrzejewski-Szmek Date: Wed, 5 Feb 2020 04:41:30 +0000 (+0100) Subject: network: change "Gateway=dhcp" to "Gateway=_dhcp" (#14774) X-Git-Tag: v245-rc1~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=427928caa4c0f6b2f34f27e801ac42a708ba9692;p=thirdparty%2Fsystemd.git network: change "Gateway=dhcp" to "Gateway=_dhcp" (#14774) This way we avoid confusion with a DNS name. Fixes #14773. --- diff --git a/NEWS b/NEWS index 2724cbaf065..181835a246d 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 1861def7da6..9e0bf69a358 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 2df8b864e88..e924723e5d9 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 1b8a3751a43..7e6f6b33e01 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 058cb33080a..ce708e7da9a 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