mirror of https://github.com/aredn/aredn.git
Fix and harminize the way tunnel IPs wrap (and avoid using 256 as an octet) (#1315)
This commit is contained in:
parent
bac75d6df3
commit
00a5cca7b5
|
@ -156,6 +156,9 @@ for (let i = 0; i < 62; i++) {
|
|||
l[3] += 4;
|
||||
if (l[3] >= 252) {
|
||||
l[2]++;
|
||||
if (l[2] === 256) {
|
||||
l[2] = 0;
|
||||
}
|
||||
l[3] = 4;
|
||||
}
|
||||
}
|
||||
|
@ -165,6 +168,9 @@ for (let i = 0; i < 126; i++) {
|
|||
w[3] += 2;
|
||||
if (w[3] >= 254) {
|
||||
w[2]++;
|
||||
if (w[2] === 256) {
|
||||
w[2] = 0;
|
||||
}
|
||||
w[3] = 2;
|
||||
}
|
||||
p++;
|
||||
|
|
|
@ -650,6 +650,9 @@ if not is_new_supernode then
|
|||
local net
|
||||
if netw[4] + cnum * 4 > 252 then
|
||||
netw[3] = netw[3] + 1
|
||||
if netw[3] == 256 then
|
||||
netw[3] = 0
|
||||
end
|
||||
netw[4] = 0
|
||||
net = 0
|
||||
cnum = 0
|
||||
|
|
Loading…
Reference in New Issue