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

bug: normalizeIPv6 does not normalize correct when double colon is already added #89

Open
2 tasks done
Uzlopak opened this issue Jun 14, 2024 · 0 comments
Open
2 tasks done

Comments

@Uzlopak
Copy link
Contributor

Uzlopak commented Jun 14, 2024

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the issue has not already been raised

Issue

normalizeIPv6 in utils can not properly normalize IPv6 addresses. Hard to describe, so here an example:

::0000:1 has to be normalized to ::1 but it is normalized to :::1
1::1:0:0:1has to be normalized to 1::1:0:0:1but is normalized to 1::1:::1

So basically in the normalizeIPv6 function we have to track if we already added the double colon, and if so, dont add again a double colon.
Also if we have added a double colon following hextets with 0 need to be written out.

In #88 I modified already the stringArrayToHexStripped I added a second parameter called keepZero. So if we already added a double colon followed by a non-zero hextet, we have to track to keep the zero and if we have following 0 hextets we have to set in stringArrayToHexStripped the parameter keepZero to true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant