]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network/dhcp4: disable IPv6OnlyMode= by default
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 4 Feb 2024 07:37:33 +0000 (16:37 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 7 Feb 2024 23:30:17 +0000 (23:30 +0000)
As explained in #30891, IPv6OnlyMode= should be enabled with 464XLAT
support, but we do not support it yet. Let's disable by default.

Fixes #30891.

man/systemd.network.xml
src/network/networkd-dhcp4.c
test/test-network/conf/25-dhcp-client-ipv6-only.network

index dfae8119e7385c7e84c3e1ccf2d4ad7421251e7c..cf4456ef0ccbce2f1bd925200de8b5a12b87ba45 100644 (file)
@@ -2683,8 +2683,7 @@ NFTSet=prefix:netdev:filter:eth_ipv4_prefix</programlisting>
           <para>When true, the DHCPv4 configuration will be delayed by the timespan provided by the DHCP
           server and skip to configure dynamic IPv4 network connectivity if IPv6 connectivity is provided
           within the timespan. See <ulink url="https://tools.ietf.org/html/rfc8925">RFC 8925</ulink>.
-          Defaults to true when <varname>IPv6AcceptRA=</varname> is enabled or DHCPv6 client is enabled
-          (i.e., <varname>DHCP=yes</varname>), and false otherwise.</para>
+          Defaults to false.</para>
 
           <xi:include href="version-info.xml" xpointer="v255"/>
         </listitem>
index f9baf0d535675c7420bcf04d852dd6e3b46f9526..b34120f9970b5005313295e2d3cc7b0143bfaea0 100644 (file)
@@ -1455,10 +1455,12 @@ static bool link_dhcp4_ipv6_only_mode(Link *link) {
         assert(link);
         assert(link->network);
 
+        /* If it is explicitly specified, then honor the setting. */
         if (link->network->dhcp_ipv6_only_mode >= 0)
                 return link->network->dhcp_ipv6_only_mode;
 
-        return link_dhcp6_enabled(link) || link_ipv6_accept_ra_enabled(link);
+        /* Defaults to false, until we support 464XLAT. See issue #30891. */
+        return false;
 }
 
 static int dhcp4_configure(Link *link) {
index 4aba206cb4bfdfbec4cdda4d4ac04b53f35471c8..1ec63b1fa6840dae2547d707a20979cb8ed9bca6 100644 (file)
@@ -7,6 +7,9 @@ Name=veth99
 DHCP=yes
 IPv6Token=::1a:2b:3c:4d
 
+[DHCPv4]
+IPv6OnlyMode=yes
+
 [Route]
 Gateway=_ipv6ra
 Destination=2001:1234:5:9fff:ff:ff:ff:ff/128