network: change "Gateway=dhcp" to "Gateway=_dhcp" (#14774)

This way we avoid confusion with a DNS name. Fixes #14773.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2020-02-05 05:41:30 +01:00 committed by GitHub
parent f2f1b52c6f
commit 427928caa4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 7 deletions

4
NEWS
View file

@ -148,8 +148,8 @@ CHANGES WITH 245 in spe:
with it's sense inverted. with it's sense inverted.
* The Gateway= setting of [Route] sections of .network files gained * The Gateway= setting of [Route] sections of .network files gained
support for a special new value "dhcp". If set the configured static support for a special new value "_dhcp". If set, the configured
route uses the gateway host configured via DHCP. static route uses the gateway host configured via DHCP.
* A new User= setting has been implemented for the [RoutingPolicyRule] * A new User= setting has been implemented for the [RoutingPolicyRule]
section of .network files for configuring source routing based on UID section of .network files for configuring source routing based on UID

View file

@ -1135,8 +1135,8 @@
<varlistentry> <varlistentry>
<term><varname>Gateway=</varname></term> <term><varname>Gateway=</varname></term>
<listitem> <listitem>
<para>Takes the gateway address or special value <literal>dhcp</literal>. If <para>Takes the gateway address or special value <literal>_dhcp</literal>. If
<literal>dhcp</literal>, then the gateway address provided by DHCP (or in the IPv6 case, <literal>_dhcp</literal>, then the gateway address provided by DHCP (or in the IPv6 case,
provided by IPv6 RA) is used.</para> provided by IPv6 RA) is used.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>

View file

@ -1006,7 +1006,7 @@ int config_parse_gateway(
if (r < 0) if (r < 0)
return r; return r;
if (streq(rvalue, "dhcp")) { if (streq(rvalue, "_dhcp")) {
n->gateway_from_dhcp = true; n->gateway_from_dhcp = true;
TAKE_PTR(n); TAKE_PTR(n);
return 0; return 0;

View file

@ -6,5 +6,5 @@ DHCP=ipv4
IPv6AcceptRA=no IPv6AcceptRA=no
[Route] [Route]
Gateway=dhcp Gateway=_dhcp
Destination=10.0.0.0/8 Destination=10.0.0.0/8

View file

@ -5,5 +5,5 @@ Name=veth99
DHCP=ipv6 DHCP=ipv6
[Route] [Route]
Gateway=dhcp Gateway=_dhcp
Destination=2001:1234:5:9fff:ff:ff:ff:ff/128 Destination=2001:1234:5:9fff:ff:ff:ff:ff/128