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

A bug with ipv6 address format #1890

Closed
hungcm95 opened this issue Feb 14, 2023 · 5 comments · Fixed by #2651
Closed

A bug with ipv6 address format #1890

hungcm95 opened this issue Feb 14, 2023 · 5 comments · Fixed by #2651
Labels

Comments

@hungcm95
Copy link

Describe the bug

Because ndpi_patchIPv6Address will replace all :0: to ::, the results may have ip like this 2600:1901::16a9:: . It's a wrong ipv6 format, it has multiple '::'

@hungcm95 hungcm95 added the bug label Feb 14, 2023
@IvanNardi
Copy link
Collaborator

This issue is real and has been already reported in the past (#819)
No sure how to move forward...

@IvanNardi
Copy link
Collaborator

I think that we can leave this issue open: we should fix it, somehow....

@IvanNardi IvanNardi reopened this Feb 14, 2023
@paolomonti
Copy link
Contributor

Hi guys, I have a very easy patch for this, If you're still interested:

--- a/src/lib/ndpi_utils.c
+++ b/src/lib/ndpi_utils.c
@@ -918,6 +921,9 @@
 void ndpi_patchIPv6Address(char *str) {
   int i = 0, j = 0;

+  if(strstr(str, "::"))
+   return;
+
   while(str[i] != '\0') {
     if((str[i] == ':')
        && (str[i+1] == '0')

Bye.

@IvanNardi
Copy link
Collaborator

IvanNardi commented Dec 19, 2024 via email

@paolomonti
Copy link
Contributor

ok

paolomonti pushed a commit to paolomonti/nDPI that referenced this issue Dec 19, 2024
ipv6 addresses already containing "::" token shall
not be searched for ":0:" nor patched
paolomonti pushed a commit to paolomonti/nDPI that referenced this issue Dec 19, 2024
ipv6 addresses already containing "::" token shall
not be searched for ":0:" nor patched
paolomonti pushed a commit to paolomonti/nDPI that referenced this issue Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants