mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 07:23:20 +00:00
nixos/networking: add assertion catching setting mac addresses on tun devices
Setting a MAC Address on a tun interface isn't supported, and invoking the corresponding command fails.
This commit is contained in:
parent
cddc7a28b8
commit
ca391c8a4f
@ -1031,6 +1031,11 @@ in
|
||||
message = ''
|
||||
Temporary addresses are only needed when IPv6 is enabled.
|
||||
'';
|
||||
})) ++ (forEach interfaces (i: {
|
||||
assertion = (i.virtual && i.virtualType == "tun") -> i.macAddress == null;
|
||||
message = ''
|
||||
Setting a MAC Address for tun device ${i.name} isn't supported.
|
||||
'';
|
||||
})) ++ [
|
||||
{
|
||||
assertion = cfg.hostId == null || (stringLength cfg.hostId == 8 && isHexString cfg.hostId);
|
||||
|
Loading…
Reference in New Issue
Block a user