diff options
author | Luca Deri <deri@ntop.org> | 2020-02-04 22:50:08 +0100 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2020-02-04 22:50:08 +0100 |
commit | fa26c62b0c3bc3d8e95ca9d42832095eedb91bfa (patch) | |
tree | 3a923ea0c994ca31df35881d975c4befa5372cac /example/reader_util.c | |
parent | 2701cc94913c4bcabbed959dadf39735b7ea8a7a (diff) |
Fix for IPv6 address format across the various platforms/distributions
Diffstat (limited to 'example/reader_util.c')
-rw-r--r-- | example/reader_util.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/example/reader_util.c b/example/reader_util.c index 3b78e0c52..6d90121d2 100644 --- a/example/reader_util.c +++ b/example/reader_util.c @@ -970,8 +970,12 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl else if(is_ndpi_proto(flow, NDPI_PROTOCOL_DNS)) { if(flow->ndpi_flow->protos.dns.rsp_type == 0x1) inet_ntop(AF_INET, &flow->ndpi_flow->protos.dns.rsp_addr.ipv4, flow->info, sizeof(flow->info)); - else + else { inet_ntop(AF_INET6, &flow->ndpi_flow->protos.dns.rsp_addr.ipv6, flow->info, sizeof(flow->info)); + + /* For consistency across platforms replace :0: with :: */ + ndpi_patchIPv6Address(flow->info); + } } /* MDNS */ else if(is_ndpi_proto(flow, NDPI_PROTOCOL_MDNS)) { |