nixos/network-interfaces: Add " around network interface names
in assertion messages to avoid misinterpretations when the interface name contains a dot.
This commit is contained in:
parent
aec3326ca4
commit
fe3751df8a
@ -923,7 +923,9 @@ in
|
|||||||
assertions =
|
assertions =
|
||||||
(flip map interfaces (i: {
|
(flip map interfaces (i: {
|
||||||
assertion = i.subnetMask == null;
|
assertion = i.subnetMask == null;
|
||||||
message = "The networking.interfaces.${i.name}.subnetMask option is defunct. Use prefixLength instead.";
|
message = ''
|
||||||
|
The networking.interfaces."${i.name}".subnetMask option is defunct. Use prefixLength instead.
|
||||||
|
'';
|
||||||
})) ++ (flip map interfaces (i: {
|
})) ++ (flip map interfaces (i: {
|
||||||
# With the linux kernel, interface name length is limited by IFNAMSIZ
|
# With the linux kernel, interface name length is limited by IFNAMSIZ
|
||||||
# to 16 bytes, including the trailing null byte.
|
# to 16 bytes, including the trailing null byte.
|
||||||
@ -934,7 +936,9 @@ in
|
|||||||
'';
|
'';
|
||||||
})) ++ (flip map slaveIfs (i: {
|
})) ++ (flip map slaveIfs (i: {
|
||||||
assertion = i.ip4 == [ ] && i.ipAddress == null && i.ip6 == [ ] && i.ipv6Address == null;
|
assertion = i.ip4 == [ ] && i.ipAddress == null && i.ip6 == [ ] && i.ipv6Address == null;
|
||||||
message = "The networking.interfaces.${i.name} must not have any defined ips when it is a slave.";
|
message = ''
|
||||||
|
The networking.interfaces."${i.name}" must not have any defined ips when it is a slave.
|
||||||
|
'';
|
||||||
})) ++ [
|
})) ++ [
|
||||||
{
|
{
|
||||||
assertion = cfg.hostId == null || (stringLength cfg.hostId == 8 && isHexString cfg.hostId);
|
assertion = cfg.hostId == null || (stringLength cfg.hostId == 8 && isHexString cfg.hostId);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user