]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: do not request RAPID_COMMIT option
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 12 Oct 2021 11:46:18 +0000 (20:46 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 12 Oct 2021 17:46:24 +0000 (02:46 +0900)
The option must not be included in OPTION_REQUEST option.
See the "Client ORO" field in
https://www.iana.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xhtml#dhcpv6-parameters-2

This deprecates RapidCommit= setting. Note that sd-dhcp6-client always
sets the RAPID_COMMIT option in the solicit message.

man/systemd.network.xml
src/network/networkd-dhcp6.c
src/network/networkd-network-gperf.gperf
src/network/networkd-network.c
src/network/networkd-network.h
test/test-network/conf/dhcp-client-ipv6-rapid-commit.network [deleted file]
test/test-network/systemd-networkd-tests.py

index abd0abbf9bbe8bb4fbf72d35a95cf4ad5ebfdbaa..bcc86417c69be294a115a22db5a1d063901684b3 100644 (file)
@@ -2100,19 +2100,6 @@ Table=1234</programlisting></para>
             <literal>information-request</literal>. Defaults to unset.</para>
           </listitem>
         </varlistentry>
-
-        <varlistentry>
-          <term><varname>RapidCommit=</varname></term>
-          <listitem>
-            <para>Takes a boolean. The DHCPv6 client can obtain configuration parameters from a DHCPv6 server through
-            a rapid two-message exchange (solicit and reply). When the rapid commit option is enabled by both
-            the DHCPv6 client and the DHCPv6 server, the two-message exchange is used, rather than the default
-            four-message exchange (solicit, advertise, request, and reply). The two-message exchange provides
-            faster client configuration and is beneficial in environments in which networks are under a heavy load.
-            See <ulink url="https://tools.ietf.org/html/rfc3315#section-17.2.1">RFC 3315</ulink> for details.
-            Defaults to true.</para>
-          </listitem>
-        </varlistentry>
       </variablelist>
   </refsect1>
 
index b42c8487ba6b0860aeb678c9034a3126866ce25c..da8a882072c07d8bfd976ca0abff19c788d3d2d8 100644 (file)
@@ -1459,12 +1459,6 @@ static int dhcp6_configure(Link *link) {
         if (r < 0)
                 return log_link_debug_errno(link, r, "DHCPv6 CLIENT: Failed to set ifindex: %m");
 
-        if (link->network->dhcp6_rapid_commit) {
-                r = sd_dhcp6_client_set_request_option(client, SD_DHCP6_OPTION_RAPID_COMMIT);
-                if (r < 0)
-                        return log_link_debug_errno(link, r, "DHCPv6 CLIENT: Failed to set request flag for rapid commit: %m");
-        }
-
         if (link->network->dhcp6_mudurl) {
                 r = sd_dhcp6_client_set_request_mud_url(client, link->network->dhcp6_mudurl);
                 if (r < 0)
index a207e374d52b5ae2f07c01fd004ea429e0d598f1..2a75a98bee816ab9696900d233c5c261913e6c5d 100644 (file)
@@ -242,7 +242,6 @@ DHCPv6.UseDNS,                               config_parse_dhcp_use_dns,
 DHCPv6.UseHostname,                          config_parse_bool,                                        0,                             offsetof(Network, dhcp6_use_hostname)
 DHCPv6.UseDomains,                           config_parse_dhcp_use_domains,                            AF_INET6,                      0
 DHCPv6.UseNTP,                               config_parse_dhcp_use_ntp,                                AF_INET6,                      0
-DHCPv6.RapidCommit,                          config_parse_bool,                                        0,                             offsetof(Network, dhcp6_rapid_commit)
 DHCPv6.MUDURL,                               config_parse_mud_url,                                     0,                             offsetof(Network, dhcp6_mudurl)
 DHCPv6.RequestOptions,                       config_parse_dhcp_request_options,                        AF_INET6,                      0
 DHCPv6.UserClass,                            config_parse_dhcp_user_or_vendor_class,                   AF_INET6,                      offsetof(Network, dhcp6_user_class)
@@ -528,11 +527,12 @@ DHCP.RouteMetric,                            config_parse_dhcp_or_ra_route_metri
 DHCP.RouteTable,                             config_parse_dhcp_or_ra_route_table,                      (RTPROT_DHCP<<16) | AF_UNSPEC, 0
 DHCP.UseTimezone,                            config_parse_bool,                                        0,                             offsetof(Network, dhcp_use_timezone)
 DHCP.ListenPort,                             config_parse_uint16,                                      0,                             offsetof(Network, dhcp_client_port)
-DHCP.RapidCommit,                            config_parse_bool,                                        0,                             offsetof(Network, dhcp6_rapid_commit)
+DHCP.RapidCommit,                            config_parse_warn_compat,                                 DISABLED_LEGACY,               0
 DHCP.ForceDHCPv6PDOtherInformation,          config_parse_bool,                                        0,                             offsetof(Network, dhcp6_force_pd_other_information)
 DHCPv4.UseDomainName,                        config_parse_dhcp_use_domains,                            AF_INET,                       0
 DHCPv4.CriticalConnection,                   config_parse_tristate,                                    0,                             offsetof(Network, dhcp_critical)
 DHCPv6.RouteMetric,                          config_parse_dhcp_or_ra_route_metric,                     AF_INET6,                      0
+DHCPv6.RapidCommit,                          config_parse_warn_compat,                                 DISABLED_LEGACY,               0
 IPv6AcceptRA.DenyList,                       config_parse_in_addr_prefixes,                            AF_INET6,                      offsetof(Network, ndisc_deny_listed_prefix)
 IPv6AcceptRA.BlackList,                      config_parse_in_addr_prefixes,                            AF_INET6,                      offsetof(Network, ndisc_deny_listed_prefix)
 TrafficControlQueueingDiscipline.Parent,                        config_parse_qdisc_parent,             _QDISC_KIND_INVALID,           0
index c3b408c4e979230bb6b748c78ac7bad9d2e73e90..a367041e9916efd16f7104f20515a738abeac9eb 100644 (file)
@@ -403,7 +403,6 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi
                 .dhcp6_use_dns = true,
                 .dhcp6_use_hostname = true,
                 .dhcp6_use_ntp = true,
-                .dhcp6_rapid_commit = true,
                 .dhcp6_duid.type = _DUID_TYPE_INVALID,
 
                 .dhcp6_pd = -1,
index ff9d1338fdad58a07a8a9c7e21d9ac49f3e0c7d6..bea882019a4cca9229120f8c3b0c79b8482a9eb2 100644 (file)
@@ -174,7 +174,6 @@ struct Network {
         bool dhcp6_use_hostname;
         bool dhcp6_use_ntp;
         bool dhcp6_use_ntp_set;
-        bool dhcp6_rapid_commit;
         bool dhcp6_route_table;
         bool dhcp6_route_table_set;
         bool dhcp6_route_table_set_explicitly;
diff --git a/test/test-network/conf/dhcp-client-ipv6-rapid-commit.network b/test/test-network/conf/dhcp-client-ipv6-rapid-commit.network
deleted file mode 100644 (file)
index 72dfbf1..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-[Match]
-Name=veth99
-
-[Network]
-DHCP=ipv6
-
-[DHCPv6]
-RapidCommit=false
index 95d526a7f71b9061af24648e92946a0b2f0eb9c3..27ccc3ce23be2260f4b8c16ad5ffea9adf395dbf 100755 (executable)
@@ -4012,7 +4012,6 @@ class NetworkdDHCPClientTests(unittest.TestCase, Utilities):
         'dhcp-client-ipv4-only.network',
         'dhcp-client-ipv4-use-routes-use-gateway.network',
         'dhcp-client-ipv6-only.network',
-        'dhcp-client-ipv6-rapid-commit.network',
         'dhcp-client-keep-configuration-dhcp-on-stop.network',
         'dhcp-client-keep-configuration-dhcp.network',
         'dhcp-client-listen-port.network',
@@ -4193,8 +4192,7 @@ class NetworkdDHCPClientTests(unittest.TestCase, Utilities):
             self.assertNotRegex(output, r'9.9.9.9 via 192.168.5.[0-9]* proto dhcp src 192.168.5.[0-9]* metric 1024')
 
     def test_dhcp_client_ipv4_ipv6(self):
-        copy_unit_to_networkd_unit_path('25-veth.netdev', 'dhcp-server-veth-peer.network', 'dhcp-client-ipv6-only.network',
-                                        'dhcp-client-ipv4-only.network')
+        copy_unit_to_networkd_unit_path('25-veth.netdev', 'dhcp-server-veth-peer.network', 'dhcp-client-ipv4-only.network')
         start_networkd()
         self.wait_online(['veth-peer:carrier'])
         start_dnsmasq()
@@ -4247,30 +4245,6 @@ class NetworkdDHCPClientTests(unittest.TestCase, Utilities):
         self.assertTrue(search_words_in_dnsmasq_log('client provides name: test-hostname'))
         self.assertTrue(search_words_in_dnsmasq_log('26:mtu'))
 
-    def test_dhcp6_client_settings_rapidcommit_true(self):
-        copy_unit_to_networkd_unit_path('25-veth.netdev', 'dhcp-server-veth-peer.network', 'dhcp-client-ipv6-only.network')
-        start_networkd()
-        self.wait_online(['veth-peer:carrier'])
-        start_dnsmasq()
-        self.wait_online(['veth99:routable', 'veth-peer:routable'])
-
-        output = check_output('ip address show dev veth99')
-        print(output)
-        self.assertRegex(output, '12:34:56:78:9a:bc')
-        self.assertTrue(search_words_in_dnsmasq_log('14:rapid-commit', True))
-
-    def test_dhcp6_client_settings_rapidcommit_false(self):
-        copy_unit_to_networkd_unit_path('25-veth.netdev', 'dhcp-server-veth-peer.network', 'dhcp-client-ipv6-rapid-commit.network')
-        start_networkd()
-        self.wait_online(['veth-peer:carrier'])
-        start_dnsmasq()
-        self.wait_online(['veth99:routable', 'veth-peer:routable'])
-
-        output = check_output('ip address show dev veth99')
-        print(output)
-        self.assertRegex(output, '12:34:56:78:9a:bc')
-        self.assertFalse(search_words_in_dnsmasq_log('14:rapid-commit', True))
-
     def test_dhcp_client_settings_anonymize(self):
         copy_unit_to_networkd_unit_path('25-veth.netdev', 'dhcp-server-veth-peer.network', 'dhcp-client-anonymize.network')
         start_networkd()