2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

silence compiler warning

This commit is contained in:
Mark Andrews
2014-05-01 14:55:04 +10:00
parent 4442141672
commit ab02ecbb30

View File

@@ -615,7 +615,7 @@ dns_geoip_match(const isc_netaddr_t *reqaddr,
GeoIPRegion *region; GeoIPRegion *region;
dns_geoip_subtype_t subtype; dns_geoip_subtype_t subtype;
isc_uint32_t ipnum = 0; isc_uint32_t ipnum = 0;
int maxlen = 0, id; int maxlen = 0, id, family;
const char *cs; const char *cs;
char *s; char *s;
#ifdef HAVE_GEOIP_V6 #ifdef HAVE_GEOIP_V6
@@ -626,7 +626,8 @@ dns_geoip_match(const isc_netaddr_t *reqaddr,
INSIST(geoip != NULL); INSIST(geoip != NULL);
switch (reqaddr->family) { family = reqaddr->family;
switch (family) {
case AF_INET: case AF_INET:
ipnum = ntohl(reqaddr->type.in.s_addr); ipnum = ntohl(reqaddr->type.in.s_addr);
break; break;
@@ -661,8 +662,7 @@ dns_geoip_match(const isc_netaddr_t *reqaddr,
INSIST(elt->as_string != NULL); INSIST(elt->as_string != NULL);
cs = country_lookup(db, subtype, reqaddr->family, cs = country_lookup(db, subtype, family, ipnum, ipnum6);
ipnum, ipnum6);
if (cs != NULL && strncasecmp(elt->as_string, cs, maxlen) == 0) if (cs != NULL && strncasecmp(elt->as_string, cs, maxlen) == 0)
return (ISC_TRUE); return (ISC_TRUE);
break; break;
@@ -682,8 +682,7 @@ dns_geoip_match(const isc_netaddr_t *reqaddr,
if (db == NULL) if (db == NULL)
return (ISC_FALSE); return (ISC_FALSE);
record = city_lookup(db, subtype, record = city_lookup(db, subtype, family, ipnum, ipnum6);
reqaddr->family, ipnum, ipnum6);
if (record == NULL) if (record == NULL)
break; break;
@@ -698,8 +697,7 @@ dns_geoip_match(const isc_netaddr_t *reqaddr,
if (db == NULL) if (db == NULL)
return (ISC_FALSE); return (ISC_FALSE);
record = city_lookup(db, subtype, record = city_lookup(db, subtype, family, ipnum, ipnum6);
reqaddr->family, ipnum, ipnum6);
if (record == NULL) if (record == NULL)
break; break;
@@ -712,8 +710,7 @@ dns_geoip_match(const isc_netaddr_t *reqaddr,
if (db == NULL) if (db == NULL)
return (ISC_FALSE); return (ISC_FALSE);
record = city_lookup(db, subtype, record = city_lookup(db, subtype, family, ipnum, ipnum6);
reqaddr->family, ipnum, ipnum6);
if (record == NULL) if (record == NULL)
break; break;
@@ -731,7 +728,7 @@ dns_geoip_match(const isc_netaddr_t *reqaddr,
INSIST(elt->as_string != NULL); INSIST(elt->as_string != NULL);
/* Region DB is not supported for IPv6 */ /* Region DB is not supported for IPv6 */
if (reqaddr->family == AF_INET6) if (family == AF_INET6)
return (ISC_FALSE); return (ISC_FALSE);
region = region_lookup(geoip->region, subtype, ipnum); region = region_lookup(geoip->region, subtype, ipnum);
@@ -765,7 +762,7 @@ dns_geoip_match(const isc_netaddr_t *reqaddr,
INSIST(elt->as_string != NULL); INSIST(elt->as_string != NULL);
/* ISP, Org, AS, and Domain are not supported for IPv6 */ /* ISP, Org, AS, and Domain are not supported for IPv6 */
if (reqaddr->family == AF_INET6) if (family == AF_INET6)
return (ISC_FALSE); return (ISC_FALSE);
s = name_lookup(db, subtype, ipnum); s = name_lookup(db, subtype, ipnum);
@@ -777,7 +774,7 @@ dns_geoip_match(const isc_netaddr_t *reqaddr,
INSIST(geoip->netspeed != NULL); INSIST(geoip->netspeed != NULL);
/* Netspeed DB is not supported for IPv6 */ /* Netspeed DB is not supported for IPv6 */
if (reqaddr->family == AF_INET6) if (family == AF_INET6)
return (ISC_FALSE); return (ISC_FALSE);
id = netspeed_lookup(geoip->netspeed, subtype, ipnum); id = netspeed_lookup(geoip->netspeed, subtype, ipnum);