]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
silence compiler warning
authorMark Andrews <marka@isc.org>
Thu, 1 May 2014 04:55:04 +0000 (14:55 +1000)
committerMark Andrews <marka@isc.org>
Thu, 1 May 2014 04:55:21 +0000 (14:55 +1000)
(cherry picked from commit ab02ecbb305e83cffef17cf91d1c9502d84631ae)

lib/dns/geoip.c

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