From: Mark Andrews Date: Thu, 13 Jan 2011 06:48:14 +0000 (+0000) Subject: explicit conversion from unsigned long to dns_rpz_cidr_bits_t X-Git-Tag: v9.8.0-P1~52 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=93b81c6d0a25f8d8a4eec3321517f0970cab8366;p=thirdparty%2Fbind9.git explicit conversion from unsigned long to dns_rpz_cidr_bits_t --- diff --git a/lib/dns/rpz.c b/lib/dns/rpz.c index 03e1a02689c..617bf813a13 100644 --- a/lib/dns/rpz.c +++ b/lib/dns/rpz.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rpz.c,v 1.5 2011/01/13 04:59:25 tbox Exp $ */ +/* $Id: rpz.c,v 1.6 2011/01/13 06:48:14 marka Exp $ */ /*! \file */ @@ -612,7 +612,7 @@ name2ipkey(dns_rpz_cidr_t *cidr, int level, dns_name_t *src_name, return (ISC_R_FAILURE); } prefix += 96; - *tgt_prefix = prefix; + *tgt_prefix = (dns_rpz_cidr_bits_t)prefix; tgt_ip->w[0] = 0; tgt_ip->w[1] = 0; tgt_ip->w[2] = ADDR_V4MAPPED; @@ -630,7 +630,7 @@ name2ipkey(dns_rpz_cidr_t *cidr, int level, dns_name_t *src_name, /* * Convert a text IPv6 address. */ - *tgt_prefix = prefix; + *tgt_prefix = (dns_rpz_cidr_bits_t)prefix; for (i = 0; ip_labels > 0 && i < DNS_RPZ_CIDR_WORDS * 2; ip_labels--) { @@ -667,7 +667,7 @@ name2ipkey(dns_rpz_cidr_t *cidr, int level, dns_name_t *src_name, /* * Check for 1s after the prefix length. */ - bits = prefix; + bits = (dns_rpz_cidr_bits_t)prefix; while (bits < DNS_RPZ_CIDR_KEY_BITS) { dns_rpz_cidr_word_t aword; @@ -685,7 +685,8 @@ name2ipkey(dns_rpz_cidr_t *cidr, int level, dns_name_t *src_name, * Convert the IPv6 address back to a canonical policy domain name * to ensure that it is in canonical form. */ - if (ISC_R_SUCCESS != ip2name(cidr, tgt_ip, prefix, type, NULL, name) || + if (ISC_R_SUCCESS != ip2name(cidr, tgt_ip, (dns_rpz_cidr_bits_t)prefix, + type, NULL, name) || !dns_name_equal(src_name, name)) { badname(level, src_name, "; not canonical"); return (ISC_R_FAILURE);