]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: rename eui64 to static
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 6 Feb 2020 11:05:16 +0000 (20:05 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 7 Feb 2020 04:30:40 +0000 (13:30 +0900)
See RFC 4291.

Follow-up for 5f506a55606fed9fd74b851a18f15a9835a26d08.

man/systemd.network.xml
src/network/networkd-ndisc.c
src/network/networkd-ndisc.h
test/test-network/conf/ipv6-prefix-veth-token-static.network [moved from test/test-network/conf/ipv6-prefix-veth-token-eui64.network with 100% similarity]
test/test-network/systemd-networkd-tests.py

index 793243f9aef834a3c011d0cd353c1ad39b31a736..02082141d216282802b84370f842ae57746a0d85 100644 (file)
             the mechanism is present, the two parts must be separated with a colon
             <literal><replaceable>type</replaceable>:<replaceable>prefix</replaceable></literal>. The
             address generation mechanism may be either <constant>prefixstable</constant> or
-            <constant>eui64</constant>. If not specified, <constant>eui64</constant> is assumed. When
+            <constant>static</constant>. If not specified, <constant>static</constant> is assumed. When
             set to <literal>prefixstable</literal> a method for generating IPv6 Interface Identifiers to
             be used with IPv6 Stateless Address Autocon figuration (SLAAC). See
             <ulink url="https://tools.ietf.org/html/rfc7217">RFC 7217</ulink>. When IPv6 address is set,
index ae38a36975a2f1cf5fbe6fdb3bff174b51f964a4..0b160bdfe64a6a3c2a2aa5bd6d7a4de13cf3d16e 100644 (file)
@@ -278,13 +278,13 @@ static int ndisc_router_generate_address(Link *link, unsigned prefixlen, uint32_
                                         break;
                                 }
                         }
-                } else if (j->address_generation_type == IPV6_TOKEN_ADDRESS_GENERATION_EUI64) {
+                } else if (j->address_generation_type == IPV6_TOKEN_ADDRESS_GENERATION_STATIC) {
                         memcpy(((uint8_t *)&address->in_addr.in6) + 8, ((uint8_t *) &j->prefix) + 8, 8);
                         prefix = true;
                         break;
                 }
 
-        /* eui64 or fallback if prefixstable do not match */
+        /* fallback to eui64 if prefixstable or static do not match */
         if (!prefix) {
                 /* see RFC4291 section 2.5.1 */
                 address->in_addr.in6.s6_addr[8]  = link->mac.ether_addr_octet[0];
@@ -992,12 +992,12 @@ int config_parse_address_generation_type(
         if (r < 0)
                 return log_oom();
 
-        if (streq(word, "eui64"))
-                token->address_generation_type = IPV6_TOKEN_ADDRESS_GENERATION_EUI64;
+        if (streq(word, "static"))
+                token->address_generation_type = IPV6_TOKEN_ADDRESS_GENERATION_STATIC;
         else if (streq(word, "prefixstable"))
                 token->address_generation_type = IPV6_TOKEN_ADDRESS_GENERATION_PREFIXSTABLE;
         else {
-                token->address_generation_type = IPV6_TOKEN_ADDRESS_GENERATION_EUI64;
+                token->address_generation_type = IPV6_TOKEN_ADDRESS_GENERATION_STATIC;
                 p = rvalue;
        }
 
index 18d1a964769e6101bc9e5a5db7457feb5ad4645a..02c2f8afda5432a3f96c0ffed94b5a2bcfaaa7b8 100644 (file)
@@ -9,7 +9,7 @@ typedef struct IPv6Token IPv6Token;
 
 typedef enum IPv6TokenAddressGeneration {
         IPV6_TOKEN_ADDRESS_GENERATION_NONE,
-        IPV6_TOKEN_ADDRESS_GENERATION_EUI64,
+        IPV6_TOKEN_ADDRESS_GENERATION_STATIC,
         IPV6_TOKEN_ADDRESS_GENERATION_PREFIXSTABLE,
         _IPV6_TOKEN_ADDRESS_GENERATION_MAX,
         _IPV6_TOKEN_ADDRESS_GENERATION_INVALID = -1,
index 454b00889d864d677753216a869c5f05413a3388..19e3634ae650803cbaa7fb2d8d6a0f4431cca937 100755 (executable)
@@ -2645,7 +2645,7 @@ class NetworkdRATests(unittest.TestCase, Utilities):
         '25-veth.netdev',
         'ipv6-prefix.network',
         'ipv6-prefix-veth.network',
-        'ipv6-prefix-veth-token-eui64.network',
+        'ipv6-prefix-veth-token-static.network',
         'ipv6-prefix-veth-token-prefixstable.network']
 
     def setUp(self):
@@ -2671,8 +2671,8 @@ class NetworkdRATests(unittest.TestCase, Utilities):
         print(output)
         self.assertRegex(output, '2002:da8:1:0')
 
-    def test_ipv6_token_eui64(self):
-        copy_unit_to_networkd_unit_path('25-veth.netdev', 'ipv6-prefix.network', 'ipv6-prefix-veth-token-eui64.network')
+    def test_ipv6_token_static(self):
+        copy_unit_to_networkd_unit_path('25-veth.netdev', 'ipv6-prefix.network', 'ipv6-prefix-veth-token-static.network')
         start_networkd()
         self.wait_online(['veth99:routable', 'veth-peer:degraded'])