nixos/networkd: rename ipv6PrefixDelegationConfig option to ipv6SendRAConfig

networkd's [IPv6PrefixDelegation] section and IPv6PrefixDelegation=
options have been renamed as [IPv6SendRA] and IPv6SendRA= in systemd
247.

Throws if the deprecated option ipv6PrefixDelegationConfig is used.
This commit is contained in:
Vincent Haupert 2021-01-30 12:33:14 +01:00
parent 735111487b
commit e6660ffe7f
No known key found for this signature in database
GPG Key ID: A8B605E96F82B4E4

View File

@ -436,7 +436,7 @@ let
"IPv4ProxyARP" "IPv4ProxyARP"
"IPv6ProxyNDP" "IPv6ProxyNDP"
"IPv6ProxyNDPAddress" "IPv6ProxyNDPAddress"
"IPv6PrefixDelegation" "IPv6SendRA"
"DHCPv6PrefixDelegation" "DHCPv6PrefixDelegation"
"IPv6MTUBytes" "IPv6MTUBytes"
"Bridge" "Bridge"
@ -478,7 +478,7 @@ let
(assertMinimum "IPv6HopLimit" 0) (assertMinimum "IPv6HopLimit" 0)
(assertValueOneOf "IPv4ProxyARP" boolValues) (assertValueOneOf "IPv4ProxyARP" boolValues)
(assertValueOneOf "IPv6ProxyNDP" boolValues) (assertValueOneOf "IPv6ProxyNDP" boolValues)
(assertValueOneOf "IPv6PrefixDelegation" ["static" "dhcpv6" "yes" "false"]) (assertValueOneOf "IPv6SendRA" boolValues)
(assertValueOneOf "DHCPv6PrefixDelegation" boolValues) (assertValueOneOf "DHCPv6PrefixDelegation" boolValues)
(assertByteFormat "IPv6MTUBytes") (assertByteFormat "IPv6MTUBytes")
(assertValueOneOf "ActiveSlave" boolValues) (assertValueOneOf "ActiveSlave" boolValues)
@ -732,7 +732,7 @@ let
(assertValueOneOf "EmitTimezone" boolValues) (assertValueOneOf "EmitTimezone" boolValues)
]; ];
sectionIPv6PrefixDelegation = checkUnitConfig "IPv6PrefixDelegation" [ sectionIPv6SendRA = checkUnitConfig "IPv6SendRA" [
(assertOnlyFields [ (assertOnlyFields [
"Managed" "Managed"
"OtherInformation" "OtherInformation"
@ -1173,13 +1173,20 @@ let
''; '';
}; };
# systemd.network.networks.*.ipv6PrefixDelegationConfig has been deprecated
# in 247 in favor of systemd.network.networks.*.ipv6SendRAConfig.
ipv6PrefixDelegationConfig = mkOption { ipv6PrefixDelegationConfig = mkOption {
visible = false;
apply = _: throw "The option `systemd.network.networks.*.ipv6PrefixDelegationConfig` has been replaced by `systemd.network.networks.*.ipv6SendRAConfig`.";
};
ipv6SendRAConfig = mkOption {
default = {}; default = {};
example = { EmitDNS = true; Managed = true; OtherInformation = true; }; example = { EmitDNS = true; Managed = true; OtherInformation = true; };
type = types.addCheck (types.attrsOf unitOption) check.network.sectionIPv6PrefixDelegation; type = types.addCheck (types.attrsOf unitOption) check.network.sectionIPv6SendRA;
description = '' description = ''
Each attribute in this set specifies an option in the Each attribute in this set specifies an option in the
<literal>[IPv6PrefixDelegation]</literal> section of the unit. See <literal>[IPv6SendRA]</literal> section of the unit. See
<citerefentry><refentrytitle>systemd.network</refentrytitle> <citerefentry><refentrytitle>systemd.network</refentrytitle>
<manvolnum>5</manvolnum></citerefentry> for details. <manvolnum>5</manvolnum></citerefentry> for details.
''; '';
@ -1540,9 +1547,9 @@ let
[DHCPServer] [DHCPServer]
${attrsToSection def.dhcpServerConfig} ${attrsToSection def.dhcpServerConfig}
'' ''
+ optionalString (def.ipv6PrefixDelegationConfig != { }) '' + optionalString (def.ipv6SendRAConfig != { }) ''
[IPv6PrefixDelegation] [IPv6SendRA]
${attrsToSection def.ipv6PrefixDelegationConfig} ${attrsToSection def.ipv6SendRAConfig}
'' ''
+ flip concatMapStrings def.ipv6Prefixes (x: '' + flip concatMapStrings def.ipv6Prefixes (x: ''
[IPv6Prefix] [IPv6Prefix]
@ -1558,7 +1565,6 @@ let
in in
{ {
options = { options = {
systemd.network.enable = mkOption { systemd.network.enable = mkOption {