From b27b6e40f888651699425245167e18b708659a04 Mon Sep 17 00:00:00 2001 From: john Date: Sat, 30 Nov 2019 21:53:17 -0500 Subject: [PATCH] Dropped dependency on libanl --- Jmakefile | 3 +-- ban2fail.c | 34 +--------------------------------- 2 files changed, 2 insertions(+), 35 deletions(-) diff --git a/Jmakefile b/Jmakefile index 2f54e2d..3211e49 100644 --- a/Jmakefile +++ b/Jmakefile @@ -17,7 +17,6 @@ src := \ cntry.c \ es.c \ ez_es.c \ - ez_libanl.c \ ez_libc.c \ ez_libz.c \ iptables.c \ @@ -32,7 +31,7 @@ src := \ str.c \ util.c \ - libs := anl z crypto GeoIP pthread + libs := z crypto GeoIP pthread endif ######################################## diff --git a/ban2fail.c b/ban2fail.c index 4728f3c..5f14d86 100644 --- a/ban2fail.c +++ b/ban2fail.c @@ -64,7 +64,6 @@ struct initInfo { static int cntryStat_count_qsort(const void *p1, const void *p2); static int configure(CFGMAP *h_cfgmap, const char *pfix); -static const char* reverse_dns_lookup(const char *addr); static int logentry_count_qsort(const void *p1, const void *p2); static int map_byCountries(LOGENTRY *e, MAP *h_map); static int stub_init(CFGMAP *map, char *symStr); @@ -88,7 +87,7 @@ struct Global G= { .version= { .major= 0, .minor= 12, - .patch= 3 + .patch= 4 }, .bitTuples.flags= GlobalFlagBitTuples @@ -690,34 +689,3 @@ map_byCountries(LOGENTRY *e, MAP *h_map) return 0; } - -static const char* -reverse_dns_lookup(const char *addr) -/************************************************************** - * Do a getaddrinfo() reverse lookup on addr - */ -{ - const char *rtn= NULL; - static char hostBuf[PATH_MAX]; - static struct addrinfo hints, - *res; - memset(&hints, 0, sizeof(hints)); - res= NULL; - - hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */ - hints.ai_flags = AI_NUMERICHOST; /* Only doing reverse lookups */ - - int rc= ez_getaddrinfo(addr, NULL, &hints, &res); - assert(0 == rc); - - assert(res && res->ai_addr && res->ai_addrlen); - - rc= ez_getnameinfo(res->ai_addr, res->ai_addrlen, hostBuf, sizeof(hostBuf)-1, NULL, 0, NI_NAMEREQD); - if(rc) return NULL; - - rtn= hostBuf; - -abort: - if(res) freeaddrinfo(res); - return rtn; -}