]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: rename IPv6Token= in [Network] -> Token= in [IPv6AcceptRA]
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 24 Sep 2021 19:52:47 +0000 (04:52 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 6 Oct 2021 16:16:36 +0000 (01:16 +0900)
The token is only used by received prefixes through RA.

man/systemd.network.xml
src/network/networkd-network-gperf.gperf
test/fuzz/fuzz-network-parser/directives.network

index 52043789ed9fa8c8e24c8cdb6371a979823cd591..7860bd10e6ec4dbc5d7efefde21f5c54eb5c0274 100644 (file)
@@ -488,53 +488,6 @@ Gateway=0.0.0.0
 Table=1234</programlisting></para>
           </listitem>
         </varlistentry>
-        <varlistentry>
-          <term><varname>IPv6Token=</varname></term>
-          <listitem>
-            <para>Specifies an optional address generation mode for the Stateless Address
-            Autoconfiguration (SLAAC). Supported modes are <literal>prefixstable</literal> and
-            <literal>static</literal>.</para>
-
-            <para>When the mode is set to <literal>static</literal>, an IPv6 address must be
-            specified after a colon (<literal>:</literal>), and the lower bits of the supplied
-            address are combined with the upper bits of a prefix received in a Router Advertisement
-            (RA) message to form a complete address. Note that if multiple prefixes are received in an
-            RA message, or in multiple RA messages, addresses will be formed from each of them using
-            the supplied address. This mode implements SLAAC but uses a static interface identifier
-            instead of an identifier generated by using the EUI-64 algorithm. Because the interface
-            identifier is static, if Duplicate Address Detection detects that the computed address is a
-            duplicate (in use by another node on the link), then this mode will fail to provide an
-            address for that prefix. If an IPv6 address without mode is specified, then
-            <literal>static</literal> mode is assumed.</para>
-
-            <para>When the mode is set to <literal>prefixstable</literal> the
-            <ulink url="https://tools.ietf.org/html/rfc7217">RFC 7217</ulink> algorithm for generating
-            interface identifiers will be used. This mode can optionally take an IPv6 address separated
-            with a colon (<literal>:</literal>). If an IPv6 address is specified, then an interface
-            identifier is generated only when a prefix received in an RA message matches the supplied
-            address.</para>
-
-            <para>If no address generation mode is specified (which is the default), or a received
-            prefix does not match any of the addresses provided in <literal>prefixstable</literal>
-            mode, then the EUI-64 algorithm will be used to form an interface identifier for that
-            prefix. This mode is also SLAAC, but with a potentially stable interface identifier which
-            does not directly map to the interface's hardware address.</para>
-
-            <para>Note that the <literal>prefixstable</literal> algorithm uses both the interface
-            name and MAC address as input to the hash to compute the interface identifier, so if either
-            of those are changed the resulting interface identifier (and address) will change, even if
-            the prefix received in the RA message has not changed.</para>
-
-            <para>This setting can be specified multiple times. If an empty string is assigned, then
-            the all previous assignments are cleared.</para>
-
-            <para>Examples:
-            <programlisting>IPv6Token=::1a:2b:3c:4d
-IPv6Token=static:::1a:2b:3c:4d
-IPv6Token=prefixstable
-IPv6Token=prefixstable:2002:da8:1::</programlisting></para>
-          </listitem>
-        </varlistentry>
         <varlistentry>
           <term><varname>LLMNR=</varname></term>
           <listitem>
@@ -2236,6 +2189,53 @@ IPv6Token=prefixstable:2002:da8:1::</programlisting></para>
       with the <varname>IPv6AcceptRA=</varname> setting described above:</para>
 
       <variablelist class='network-directives'>
+        <varlistentry>
+          <term><varname>Token=</varname></term>
+          <listitem>
+            <para>Specifies an optional address generation mode for the Stateless Address
+            Autoconfiguration (SLAAC). Supported modes are <literal>static</literal> and
+            <literal>prefixstable</literal>.</para>
+
+            <para>When the mode is set to <literal>static</literal>, an IPv6 address must be
+            specified after a colon (<literal>:</literal>), and the lower bits of the supplied
+            address are combined with the upper bits of a prefix received in a Router Advertisement
+            (RA) message to form a complete address. Note that if multiple prefixes are received in an
+            RA message, or in multiple RA messages, addresses will be formed from each of them using
+            the supplied address. This mode implements SLAAC but uses a static interface identifier
+            instead of an identifier generated by using the EUI-64 algorithm. Because the interface
+            identifier is static, if Duplicate Address Detection detects that the computed address is a
+            duplicate (in use by another node on the link), then this mode will fail to provide an
+            address for that prefix. If an IPv6 address without mode is specified, then
+            <literal>static</literal> mode is assumed.</para>
+
+            <para>When the mode is set to <literal>prefixstable</literal> the
+            <ulink url="https://tools.ietf.org/html/rfc7217">RFC 7217</ulink> algorithm for generating
+            interface identifiers will be used. This mode can optionally take an IPv6 address separated
+            with a colon (<literal>:</literal>). If an IPv6 address is specified, then an interface
+            identifier is generated only when a prefix received in an RA message matches the supplied
+            address.</para>
+
+            <para>If no address generation mode is specified (which is the default), or a received
+            prefix does not match any of the addresses provided in <literal>prefixstable</literal>
+            mode, then the EUI-64 algorithm will be used to form an interface identifier for that
+            prefix.</para>
+
+            <para>Note that the <literal>prefixstable</literal> algorithm uses both the interface
+            name and MAC address as input to the hash to compute the interface identifier, so if either
+            of those are changed the resulting interface identifier (and address) will be changed, even
+            if the prefix received in the RA message has not been changed.</para>
+
+            <para>This setting can be specified multiple times. If an empty string is assigned, then
+            the all previous assignments are cleared.</para>
+
+            <para>Examples:
+            <programlisting>Token=::1a:2b:3c:4d
+Token=static:::1a:2b:3c:4d
+Token=prefixstable
+Token=prefixstable:2002:da8:1::</programlisting></para>
+          </listitem>
+        </varlistentry>
+
         <varlistentry>
           <term><varname>UseDNS=</varname></term>
           <listitem>
index 9aa253e1d9441b466cdf681bc7df781f83359bd5..ce7e6c089eac38eac52ce422f573185be082764d 100644 (file)
@@ -104,7 +104,6 @@ Network.IPv6LinkLocalAddressGenerationMode,  config_parse_ipv6_link_local_addres
 Network.IPv6StableSecretAddress,             config_parse_in_addr_non_null,                            AF_INET6,                      offsetof(Network, ipv6ll_stable_secret)
 Network.IPv4LLRoute,                         config_parse_bool,                                        0,                             offsetof(Network, ipv4ll_route)
 Network.DefaultRouteOnDevice,                config_parse_bool,                                        0,                             offsetof(Network, default_route_on_device)
-Network.IPv6Token,                           config_parse_address_generation_type,                     0,                             offsetof(Network, ndisc_tokens)
 Network.LLDP,                                config_parse_lldp_mode,                                   0,                             offsetof(Network, lldp_mode)
 Network.EmitLLDP,                            config_parse_lldp_multicast_mode,                         0,                             offsetof(Network, lldp_multicast_mode)
 Network.Address,                             config_parse_address,                                     0,                             0
@@ -271,6 +270,7 @@ IPv6AcceptRA.PrefixAllowList,                config_parse_in_addr_prefixes,
 IPv6AcceptRA.PrefixDenyList,                 config_parse_in_addr_prefixes,                            AF_INET6,                      offsetof(Network, ndisc_deny_listed_prefix)
 IPv6AcceptRA.RouteAllowList,                 config_parse_in_addr_prefixes,                            AF_INET6,                      offsetof(Network, ndisc_allow_listed_route_prefix)
 IPv6AcceptRA.RouteDenyList,                  config_parse_in_addr_prefixes,                            AF_INET6,                      offsetof(Network, ndisc_deny_listed_route_prefix)
+IPv6AcceptRA.Token,                          config_parse_address_generation_type,                     0,                             offsetof(Network, ndisc_tokens)
 DHCPServer.ServerAddress,                    config_parse_dhcp_server_address,                         0,                             0
 DHCPServer.UplinkInterface,                  config_parse_uplink,                                      0,                             0
 DHCPServer.RelayTarget,                      config_parse_in_addr_non_null,                            AF_INET,                       offsetof(Network, dhcp_server_relay_target)
@@ -493,6 +493,7 @@ TrivialLinkEqualizer.Handle,                 config_parse_qdisc_handle,
 TrivialLinkEqualizer.Id,                     config_parse_trivial_link_equalizer_id,                   QDISC_KIND_TEQL,               0
 /* backwards compatibility: do not add new entries to this section */
 Network.IPv4LL,                              config_parse_ipv4ll,                                      0,                             offsetof(Network, link_local)
+Network.IPv6Token,                           config_parse_address_generation_type,                     0,                             offsetof(Network, ndisc_tokens)
 Network.IPv6PrefixDelegation,                config_parse_router_prefix_delegation,                    0,                             offsetof(Network, router_prefix_delegation)
 IPv6PrefixDelegation.RouterLifetimeSec,      config_parse_sec,                                         0,                             offsetof(Network, router_lifetime_usec)
 IPv6PrefixDelegation.Managed,                config_parse_bool,                                        0,                             offsetof(Network, router_managed)
index fdd7f73baeef2994751cf32f2dceb153fc732409..9b5ecccedbbc4d2d1336c99c063780be1e36869f 100644 (file)
@@ -359,6 +359,7 @@ RouteAllowList=
 RouteDenyList=
 DenyList=
 BlackList=
+Token=
 [DHCPServer]
 EmitNTP=
 PoolSize=