Skip to content

Commit

Permalink
Fix constructTables for IPv6 netmasks in Aggregator
Browse files Browse the repository at this point in the history
The last octet still needs to be iterated through. Appending :0 to the mask will make it an invalid netmask.

Fixes: #486
  • Loading branch information
neufeind committed Aug 3, 2023
1 parent 9146007 commit a58d82e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vault/CIDRAM/CIDRAM/Aggregator.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ private function constructTables(): void
$CIDR = 128;
for ($Octet = 8; $Octet > 0; $Octet--) {
$Base = str_repeat('ffff:', $Octet - 1);
$End = ($Octet === 8) ? ':0' : '::';
$End = ($Octet === 8) ? '' : '::';
for ($Addresses = 1, $Iterate = 0; $Iterate < 16; $Iterate++, $Addresses *= 2, $CIDR--) {
$Netmask = $Base . (dechex(65536 - $Addresses)) . $End;
$this->TableNetmaskIPv6[$CIDR] = $Netmask;
Expand Down

0 comments on commit a58d82e

Please sign in to comment.