From 55b986d253fcae830d4a5daeaee6b1a784bebef0 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Sun, 9 Jan 2022 22:20:35 -0500 Subject: nettrace --- src/fnettrace/hostnames.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/fnettrace/hostnames.c') diff --git a/src/fnettrace/hostnames.c b/src/fnettrace/hostnames.c index e1ad45f81..733d13853 100644 --- a/src/fnettrace/hostnames.c +++ b/src/fnettrace/hostnames.c @@ -21,8 +21,14 @@ #include "radix.h" #define MAXBUF 1024 +int geoip_calls = 0; +static int geoip_not_found = 0; char *retrieve_hostname(uint32_t ip) { + if (geoip_not_found) + return NULL; + geoip_calls++; + char *rv = NULL; char *cmd; if (asprintf(&cmd, "/usr/bin/geoiplookup %d.%d.%d.%d", PRINT_IP(ip)) == -1) @@ -47,6 +53,10 @@ char *retrieve_hostname(uint32_t ip) { fclose(fp); return rv; } + else + geoip_not_found = 1; + + free(cmd); return NULL; } -- cgit v1.2.3-54-g00ecf