Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregator constructs wrong IPv6 netmask for last octet #486

Closed
neufeind opened this issue Aug 3, 2023 · 0 comments · Fixed by #487
Closed

Aggregator constructs wrong IPv6 netmask for last octet #486

neufeind opened this issue Aug 3, 2023 · 0 comments · Fixed by #487

Comments

@neufeind
Copy link
Contributor

neufeind commented Aug 3, 2023

Code in https://github.com/CIDRAM/CIDRAM/tree/v3/vault/CIDRAM/CIDRAM/Aggregator.php in constructTables() creates wrong netmasks for the last octet.

Netmasks are fine for:
["ffff:ffff:ffff:ffff:ffff:ffff:ffff::"]=>
int(112)
["ffff:ffff:ffff:ffff:ffff:ffff:fffe::"]=>
int(111)
["ffff:ffff:ffff:ffff:ffff:ffff:fffc::"]=>
and then wrong for the last octet:
["ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff:0"]=>
int(128)
["ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffe:0"]=>
int(127)
["ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffc:0"]=>
int(126)
["ffff:ffff:ffff:ffff:ffff:ffff:ffff:fff8:0"]=>
int(125)
["ffff:ffff:ffff:ffff:ffff:ffff:ffff:fff0:0"]=>
int(124)
["ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffe0:0"]=>
int(123)
["ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffc0:0"]=>
int(122)
["ffff:ffff:ffff:ffff:ffff:ffff:ffff:ff80:0"]=>
int(121)
["ffff:ffff:ffff:ffff:ffff:ffff:ffff:ff00:0"]=>
int(120)
["ffff:ffff:ffff:ffff:ffff:ffff:ffff:fe00:0"]=>
int(119)
["ffff:ffff:ffff:ffff:ffff:ffff:ffff:fc00:0"]=>
int(118)
["ffff:ffff:ffff:ffff:ffff:ffff:ffff:f800:0"]=>
int(117)
["ffff:ffff:ffff:ffff:ffff:ffff:ffff:f000:0"]=>
int(116)
["ffff:ffff:ffff:ffff:ffff:ffff:ffff:e000:0"]=>
int(115)
["ffff:ffff:ffff:ffff:ffff:ffff:ffff:c000:0"]=>
int(114)
["ffff:ffff:ffff:ffff:ffff:ffff:ffff:8000:0"]=>
int(113)

The :0 is too much there if we fully iterate through the last octet as well.

Fix is to append only an empty string, not :0, for the last octet:
$End = ($Octet === 8) ? '' : '::';

Maikuolan added a commit that referenced this issue Aug 3, 2023
Changelog excerpt:
- The aggregator's constructTables method was constructing the wrong IPv6
  netmask for last hextet; Fixed.
Maikuolan added a commit that referenced this issue Aug 3, 2023
Changelog excerpt:
- The aggregator's constructTables method was constructing the wrong IPv6
  netmask for last hextet; Fixed.
Maikuolan added a commit that referenced this issue Aug 3, 2023
Changelog excerpt:
- The aggregator's constructTables method was constructing the wrong IPv6
  netmask for last hextet; Fixed.
Maikuolan added a commit to CIDRAM/Aggregator that referenced this issue Aug 3, 2023
Changelog excerpt:
- The aggregator's constructTables method was constructing the wrong IPv6
  netmask for last hextet; Fixed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants