diff options
| author | Russ White <russ@riw.us> | 2024-10-16 13:01:52 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-16 13:01:52 -0400 |
| commit | 75e34c032b97016d623e4e3c3b8a600c3890d4af (patch) | |
| tree | 83c1fa26e3013f1b4bfe7f0ead7cbb4a00574df5 /lib/ntop.c | |
| parent | 1ce225d7e489f323c7eb8ae3f4c466bec7f6e490 (diff) | |
| parent | 3c430cd4e0084dc19320552c9dc476417f09f73d (diff) | |
Merge pull request #16452 from louis-6wind/fix-ipv4-mapped-ipv6-display
lib, test: fix display ipv4 mapped ipv6 addresses
Diffstat (limited to 'lib/ntop.c')
| -rw-r--r-- | lib/ntop.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/ntop.c b/lib/ntop.c index 89b4d5ecdc..edf03cd076 100644 --- a/lib/ntop.c +++ b/lib/ntop.c @@ -116,7 +116,18 @@ inet4: best = i - curlen; bestlen = curlen; } - /* do we want ::ffff:A.B.C.D? */ + if (best == 0 && bestlen == 5 && b[10] == 0xff && b[11] == 0xff) { + /* ::ffff:A.B.C.D */ + *o++ = ':'; + *o++ = ':'; + *o++ = 'f'; + *o++ = 'f'; + *o++ = 'f'; + *o++ = 'f'; + *o++ = ':'; + b += 12; + goto inet4; + } if (best == 0 && bestlen == 6) { *o++ = ':'; *o++ = ':'; |
