diff options
author | tv <tv@krebsco.de> | 2018-12-14 20:03:26 +0100 |
---|---|---|
committer | tv <tv@krebsco.de> | 2018-12-14 20:03:26 +0100 |
commit | ede763d77af82763d45ae4c3edb01d26f68581d5 (patch) | |
tree | 2bdc91d11bc8bc17721b28a5afb8aaa0eb4881b9 /lib/krebs/genipv6.nix | |
parent | 2d243bbeac37b2bf63dedb88588d7e7da9c0db26 (diff) |
lib.krebs.genipv6: normalize net addresses
Diffstat (limited to 'lib/krebs/genipv6.nix')
-rw-r--r-- | lib/krebs/genipv6.nix | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/krebs/genipv6.nix b/lib/krebs/genipv6.nix index b4806e156..1d3f398ec 100644 --- a/lib/krebs/genipv6.nix +++ b/lib/krebs/genipv6.nix @@ -12,7 +12,8 @@ let { inherit netname; netCIDR = "${netAddress}/${toString netPrefixLength}"; - netAddress = appendZeros addressLength netPrefix; + netAddress = + normalize-ip6-addr (appendZeros addressLength netPrefix); netHash = toString { retiolum = 0; wirelum = 1; @@ -25,7 +26,8 @@ let { inherit subnetname; subnetCIDR = "${subnetAddress}/${toString subnetPrefixLength}"; - subnetAddress = appendZeros addressLength subnetPrefix; + subnetAddress = + normalize-ip6-addr (appendZeros addressLength subnetPrefix); subnetHash = hashToLength 4 subnetname; subnetPrefix = joinAddress netPrefix subnetHash; subnetPrefixLength = netPrefixLength + 16; |