DNS: extract geolocation information, if available (#2065)

The option NSID (RFC5001) is used by Google DNS to report the
airport code of the metro where the DNS query is handled.

This option is quite rare, but the added overhead in DNS code is pretty
much zero for "normal" DNS traffic
This commit is contained in:
Ivan Nardi
2023-07-31 07:44:43 +02:00
committed by GitHub
parent d477da997f
commit 5019022e13
7 changed files with 72 additions and 1 deletions
+2
View File
@@ -1228,6 +1228,8 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
/* For consistency across platforms replace :0: with :: */
ndpi_patchIPv6Address(flow->info);
}
if(flow->ndpi_flow->protos.dns.geolocation_iata_code[0] != '\0')
strcpy(flow->dns.geolocation_iata_code, flow->ndpi_flow->protos.dns.geolocation_iata_code);
}
/* MDNS */
else if(is_ndpi_proto(flow, NDPI_PROTOCOL_MDNS)) {