summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2018-12-15 12:28:05 +0100
committerlassulus <lassulus@lassul.us>2018-12-15 12:28:05 +0100
commitc0d5d92c42ec5517d84157305db0fb601e6db6e5 (patch)
tree9e3e13dd301520a5824988459aac2f36949d384c /lib
parentd49adb05b90f41e4bb2614a0ca8848af72bd27e9 (diff)
parentd287baa0561f69a05930995e8ea1d662a13affee (diff)
Merge remote-tracking branch 'ni/master'
Diffstat (limited to 'lib')
-rw-r--r--lib/krebs/genipv6.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/krebs/genipv6.nix b/lib/krebs/genipv6.nix
index af1df6d..1d3f398 100644
--- a/lib/krebs/genipv6.nix
+++ b/lib/krebs/genipv6.nix
@@ -12,7 +12,8 @@ let {
inherit netname;
netCIDR = "${netAddress}/${toString netPrefixLength}";
- netAddress = appendZeros netPrefixLength 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 subnetPrefixLength subnetPrefix;
+ subnetAddress =
+ normalize-ip6-addr (appendZeros addressLength subnetPrefix);
subnetHash = hashToLength 4 subnetname;
subnetPrefix = joinAddress netPrefix subnetHash;
subnetPrefixLength = netPrefixLength + 16;