Skip to content

Commit

Permalink
IPv6: fix bad ipv6 format (#1890) (#2651)
Browse files Browse the repository at this point in the history
ipv6 addresses already containing "::" token shall
not be searched for ":0:" nor patched

Close #1890
  • Loading branch information
paolomonti authored Dec 20, 2024
1 parent b2c2453 commit 3b602e7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/lib/ndpi_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,9 @@ char* ndpi_ssl_version2str(char *buf, int buf_len,
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')
Expand Down
2 changes: 1 addition & 1 deletion tests/cfgs/default/result/fuzz-2021-10-13.pcap.out
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ Unrated 1 197 1


Undetected flows:
1 TCP [3400:3a30:3035:2f75:706c:6f32:643f:6c3d]:44288 -> [302e::3d00::8001]:0 [proto: 0/Unknown][IP: 0/Unknown][ClearText][Confidence: Unknown][FPC: 0/Unknown, Confidence: Unknown][DPI packets: 1][1 pkts/197 bytes -> 0 pkts/0 bytes][Goodput ratio: 75/0][< 1 sec][Risk: ** Unidirectional Traffic **** TCP Connection Issues **][Risk Score: 60][Risk Info: TCP NULL scan / No server to client traffic][PLAIN TEXT (005/uplo2)][Plen Bins: 0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
1 TCP [3400:3a30:3035:2f75:706c:6f32:643f:6c3d]:44288 -> [302e::3d00:0:8001]:0 [proto: 0/Unknown][IP: 0/Unknown][ClearText][Confidence: Unknown][FPC: 0/Unknown, Confidence: Unknown][DPI packets: 1][1 pkts/197 bytes -> 0 pkts/0 bytes][Goodput ratio: 75/0][< 1 sec][Risk: ** Unidirectional Traffic **** TCP Connection Issues **][Risk Score: 60][Risk Info: TCP NULL scan / No server to client traffic][PLAIN TEXT (005/uplo2)][Plen Bins: 0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
Loading

0 comments on commit 3b602e7

Please sign in to comment.