From fa26c62b0c3bc3d8e95ca9d42832095eedb91bfa Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Tue, 4 Feb 2020 22:50:08 +0100 Subject: Fix for IPv6 address format across the various platforms/distributions --- example/reader_util.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'example') 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)) { -- cgit v1.2.3