forked from zentralwerk/network
nix/pkgs/subnetplan: cap max_prefix at 64
This commit is contained in:
parent
557f63b7c1
commit
f98412346e
|
@ -63,7 +63,7 @@ nets.each do |net|
|
||||||
(groups[group] ||= []) << net
|
(groups[group] ||= []) << net
|
||||||
end
|
end
|
||||||
|
|
||||||
max_prefix = groups.collect { nets.collect { |net| net.addr.prefix }.max }.max
|
max_prefix = [groups.collect { nets.collect { |net| net.addr.prefix }.max }.max, 64].min
|
||||||
groups = groups.collect do |group, nets|
|
groups = groups.collect do |group, nets|
|
||||||
allnet = nets[0].addr.clone
|
allnet = nets[0].addr.clone
|
||||||
while allnet.prefix > 0 and not allnet.include?(nets[nets.size - 1].addr)
|
while allnet.prefix > 0 and not allnet.include?(nets[nets.size - 1].addr)
|
||||||
|
|
Loading…
Reference in New Issue