From 5a81693ef3e709a630d510c9fbf23c1bca89522d Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Fri, 21 Aug 2020 22:35:54 +0200 Subject: [PATCH] netns: add range check for netns ids --- modules/netns-isolation.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/netns-isolation.nix b/modules/netns-isolation.nix index 2d66224..9d5e164 100644 --- a/modules/netns-isolation.nix +++ b/modules/netns-isolation.nix @@ -53,12 +53,11 @@ in { type = types.attrsOf (types.submodule { options = { id = mkOption { - # TODO: Exclude 10 # TODO: Assert uniqueness - type = types.int; + type = types.ints.between 11 255; description = '' - id for the netns, that is used for the IP address host part and - naming the interfaces. Must be unique. Must not be 10. + id for the netns, used for the IP address host part and + for naming the interfaces. Must be unique. Must be greater than 10. ''; }; connections = mkOption {