@@ -924,6 +924,14 @@ in
924924 (flip map interfaces (i: {
925925 assertion = i.subnetMask == null;
926926 message = "The networking.interfaces.${i.name}.subnetMask option is defunct. Use prefixLength instead.";
927+ })) ++ (flip map interfaces (i: {
928+ # With the linux kernel, interface name length is limited by IFNAMSIZ
929+ # to 16 bytes, including the trailing null byte.
930+ # See include/linux/if.h in the kernel sources
931+ assertion = stringLength i.name < 16;
932+ message = ''
933+ The name of networking.interfaces."${i.name}" is too long, it needs to be less than 16 characters.
934+ '';
927935 })) ++ (flip map slaveIfs (i: {
928936 assertion = i.ip4 == [ ] && i.ipAddress == null && i.ip6 == [ ] && i.ipv6Address == null;
929937 message = "The networking.interfaces.${i.name} must not have any defined ips when it is a slave.";