Skip to content

Commit e2c4070

Browse files
committed
network: rename eui64 to static
See RFC 4291. Follow-up for 5f506a5.
1 parent 6e55b9b commit e2c4070

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

man/systemd.network.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@
312312
the mechanism is present, the two parts must be separated with a colon
313313
<literal><replaceable>type</replaceable>:<replaceable>prefix</replaceable></literal>. The
314314
address generation mechanism may be either <constant>prefixstable</constant> or
315-
<constant>eui64</constant>. If not specified, <constant>eui64</constant> is assumed. When
315+
<constant>static</constant>. If not specified, <constant>static</constant> is assumed. When
316316
set to <literal>prefixstable</literal> a method for generating IPv6 Interface Identifiers to
317317
be used with IPv6 Stateless Address Autocon figuration (SLAAC). See
318318
<ulink url="https://tools.ietf.org/html/rfc7217">RFC 7217</ulink>. When IPv6 address is set,

src/network/networkd-ndisc.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,13 @@ static int ndisc_router_generate_address(Link *link, unsigned prefixlen, uint32_
278278
break;
279279
}
280280
}
281-
} else if (j->address_generation_type == IPV6_TOKEN_ADDRESS_GENERATION_EUI64) {
281+
} else if (j->address_generation_type == IPV6_TOKEN_ADDRESS_GENERATION_STATIC) {
282282
memcpy(((uint8_t *)&address->in_addr.in6) + 8, ((uint8_t *) &j->prefix) + 8, 8);
283283
prefix = true;
284284
break;
285285
}
286286

287-
/* eui64 or fallback if prefixstable do not match */
287+
/* fallback to eui64 if prefixstable or static do not match */
288288
if (!prefix) {
289289
/* see RFC4291 section 2.5.1 */
290290
address->in_addr.in6.s6_addr[8] = link->mac.ether_addr_octet[0];
@@ -992,12 +992,12 @@ int config_parse_address_generation_type(
992992
if (r < 0)
993993
return log_oom();
994994

995-
if (streq(word, "eui64"))
996-
token->address_generation_type = IPV6_TOKEN_ADDRESS_GENERATION_EUI64;
995+
if (streq(word, "static"))
996+
token->address_generation_type = IPV6_TOKEN_ADDRESS_GENERATION_STATIC;
997997
else if (streq(word, "prefixstable"))
998998
token->address_generation_type = IPV6_TOKEN_ADDRESS_GENERATION_PREFIXSTABLE;
999999
else {
1000-
token->address_generation_type = IPV6_TOKEN_ADDRESS_GENERATION_EUI64;
1000+
token->address_generation_type = IPV6_TOKEN_ADDRESS_GENERATION_STATIC;
10011001
p = rvalue;
10021002
}
10031003

src/network/networkd-ndisc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ typedef struct IPv6Token IPv6Token;
99

1010
typedef enum IPv6TokenAddressGeneration {
1111
IPV6_TOKEN_ADDRESS_GENERATION_NONE,
12-
IPV6_TOKEN_ADDRESS_GENERATION_EUI64,
12+
IPV6_TOKEN_ADDRESS_GENERATION_STATIC,
1313
IPV6_TOKEN_ADDRESS_GENERATION_PREFIXSTABLE,
1414
_IPV6_TOKEN_ADDRESS_GENERATION_MAX,
1515
_IPV6_TOKEN_ADDRESS_GENERATION_INVALID = -1,

test/test-network/conf/ipv6-prefix-veth-token-eui64.network renamed to test/test-network/conf/ipv6-prefix-veth-token-static.network

File renamed without changes.

test/test-network/systemd-networkd-tests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2645,7 +2645,7 @@ class NetworkdRATests(unittest.TestCase, Utilities):
26452645
'25-veth.netdev',
26462646
'ipv6-prefix.network',
26472647
'ipv6-prefix-veth.network',
2648-
'ipv6-prefix-veth-token-eui64.network',
2648+
'ipv6-prefix-veth-token-static.network',
26492649
'ipv6-prefix-veth-token-prefixstable.network']
26502650

26512651
def setUp(self):
@@ -2671,8 +2671,8 @@ def test_ipv6_prefix_delegation(self):
26712671
print(output)
26722672
self.assertRegex(output, '2002:da8:1:0')
26732673

2674-
def test_ipv6_token_eui64(self):
2675-
copy_unit_to_networkd_unit_path('25-veth.netdev', 'ipv6-prefix.network', 'ipv6-prefix-veth-token-eui64.network')
2674+
def test_ipv6_token_static(self):
2675+
copy_unit_to_networkd_unit_path('25-veth.netdev', 'ipv6-prefix.network', 'ipv6-prefix-veth-token-static.network')
26762676
start_networkd()
26772677
self.wait_online(['veth99:routable', 'veth-peer:degraded'])
26782678

0 commit comments

Comments
 (0)