diff --git a/lib/dns/geoip2.c b/lib/dns/geoip2.c index 513e423fa5..c0ab66a241 100644 --- a/lib/dns/geoip2.c +++ b/lib/dns/geoip2.c @@ -326,7 +326,7 @@ dns_geoip_match(const isc_netaddr_t *reqaddr, geoip_state_t *state = NULL; dns_geoip_subtype_t subtype; const char *s = NULL; - int ret, i; + int ret; REQUIRE(reqaddr != NULL); REQUIRE(elt != NULL); @@ -347,7 +347,7 @@ dns_geoip_match(const isc_netaddr_t *reqaddr, case dns_geoip_country_code: case dns_geoip_city_countrycode: ret = MMDB_get_value(&state->entry, &value, - "country", "iso_code", NULL); + "country", "iso_code", (char *)0); if (ret == MMDB_SUCCESS) { return (match_string(&value, elt->as_string)); } @@ -356,7 +356,7 @@ dns_geoip_match(const isc_netaddr_t *reqaddr, case dns_geoip_country_name: case dns_geoip_city_countryname: ret = MMDB_get_value(&state->entry, &value, - "country", "names", "en", NULL); + "country", "names", "en", (char *)0); if (ret == MMDB_SUCCESS) { return (match_string(&value, elt->as_string)); } @@ -365,7 +365,7 @@ dns_geoip_match(const isc_netaddr_t *reqaddr, case dns_geoip_country_continentcode: case dns_geoip_city_continentcode: ret = MMDB_get_value(&state->entry, &value, - "continent", "code", NULL); + "continent", "code", (char *)0); if (ret == MMDB_SUCCESS) { return (match_string(&value, elt->as_string)); } @@ -374,7 +374,7 @@ dns_geoip_match(const isc_netaddr_t *reqaddr, case dns_geoip_country_continent: case dns_geoip_city_continent: ret = MMDB_get_value(&state->entry, &value, - "continent", "names", "en", NULL); + "continent", "names", "en", (char *)0); if (ret == MMDB_SUCCESS) { return (match_string(&value, elt->as_string)); } @@ -383,7 +383,7 @@ dns_geoip_match(const isc_netaddr_t *reqaddr, case dns_geoip_region: case dns_geoip_city_region: ret = MMDB_get_value(&state->entry, &value, - "subdivisions", "0", "iso_code", NULL); + "subdivisions", "0", "iso_code", (char *)0); if (ret == MMDB_SUCCESS) { return (match_string(&value, elt->as_string)); } @@ -392,7 +392,7 @@ dns_geoip_match(const isc_netaddr_t *reqaddr, case dns_geoip_regionname: case dns_geoip_city_regionname: ret = MMDB_get_value(&state->entry, &value, - "subdivisions", "0", "names", "en", NULL); + "subdivisions", "0", "names", "en", (char *)0); if (ret == MMDB_SUCCESS) { return (match_string(&value, elt->as_string)); } @@ -400,7 +400,7 @@ dns_geoip_match(const isc_netaddr_t *reqaddr, case dns_geoip_city_name: ret = MMDB_get_value(&state->entry, &value, - "city", "names", "en", NULL); + "city", "names", "en", (char *)0); if (ret == MMDB_SUCCESS) { return (match_string(&value, elt->as_string)); } @@ -408,7 +408,7 @@ dns_geoip_match(const isc_netaddr_t *reqaddr, case dns_geoip_city_postalcode: ret = MMDB_get_value(&state->entry, &value, - "postal", "code", NULL); + "postal", "code", (char *)0); if (ret == MMDB_SUCCESS) { return (match_string(&value, elt->as_string)); } @@ -416,7 +416,7 @@ dns_geoip_match(const isc_netaddr_t *reqaddr, case dns_geoip_city_timezonecode: ret = MMDB_get_value(&state->entry, &value, - "location", "time_zone", NULL); + "location", "time_zone", (char *)0); if (ret == MMDB_SUCCESS) { return (match_string(&value, elt->as_string)); } @@ -425,14 +425,14 @@ dns_geoip_match(const isc_netaddr_t *reqaddr, case dns_geoip_city_metrocode: ret = MMDB_get_value(&state->entry, &value, - "location", "metro_code", NULL); + "location", "metro_code", (char *)0); if (ret == MMDB_SUCCESS) { return (match_string(&value, elt->as_string)); } break; case dns_geoip_isp_name: - ret = MMDB_get_value(&state->entry, &value, "isp", NULL); + ret = MMDB_get_value(&state->entry, &value, "isp", (char *)0); if (ret == MMDB_SUCCESS) { return (match_string(&value, elt->as_string)); } @@ -442,8 +442,9 @@ dns_geoip_match(const isc_netaddr_t *reqaddr, INSIST(elt->as_string != NULL); ret = MMDB_get_value(&state->entry, &value, - "autonomous_system_number", NULL); + "autonomous_system_number", (char *)0); if (ret == MMDB_SUCCESS) { + int i; s = elt->as_string; if (strncasecmp(s, "AS", 2) == 0) { s += 2; @@ -455,14 +456,14 @@ dns_geoip_match(const isc_netaddr_t *reqaddr, case dns_geoip_org_name: ret = MMDB_get_value(&state->entry, &value, - "autonomous_system_organization", NULL); + "autonomous_system_organization", (char *)0); if (ret == MMDB_SUCCESS) { return (match_string(&value, elt->as_string)); } break; case dns_geoip_domain_name: - ret = MMDB_get_value(&state->entry, &value, "domain", NULL); + ret = MMDB_get_value(&state->entry, &value, "domain", (char *)0); if (ret == MMDB_SUCCESS) { return (match_string(&value, elt->as_string)); }