+4412. [cleanup] Make fixes for GCC 6. ISC_OFFSET_MAXIMUM macro was
+ removed. [RT #42721]
+
4411. [func] "rndc dnstap -roll" automatically rolls the
dnstap output file; the previous version is
saved with ".0" suffix, and earlier versions
/* Mask off last address byte */
if (addrl > 0 && (plen % 8) != 0)
- addr[addrl - 1] &= ~0 << (8 - (plen % 8));
+ addr[addrl - 1] &= ~0U << (8 - (plen % 8));
/* family */
isc_buffer_putuint16(&b, family);
optlen -= addrbytes;
if ((addrlen % 8) != 0) {
- isc_uint8_t bits = ~0 << (8 - (addrlen % 8));
+ isc_uint8_t bits = ~0U << (8 - (addrlen % 8));
bits &= paddr[addrbytes - 1];
if (bits != paddr[addrbytes - 1])
return (DNS_R_OPTERR);
cfg_tuple_get(fileobj, "versions");
isc_int32_t versions = ISC_LOG_ROLLNEVER;
isc_offset_t size = 0;
+ isc_uint64_t maxoffset;
+
+ /*
+ * isc_offset_t is a signed integer type, so the maximum
+ * value is all 1s except for the MSB.
+ */
+ switch (sizeof(isc_offset_t)) {
+ case 4:
+ maxoffset = 0x7fffffffLLU;
+ break;
+ case 8:
+ maxoffset = 0x7fffffffffffffffLLU;
+ break;
+ default:
+ INSIST(0);
+ }
type = ISC_LOG_TOFILE;
versions = ISC_LOG_ROLLINFINITE;
if (sizeobj != NULL &&
cfg_obj_isuint64(sizeobj) &&
- cfg_obj_asuint64(sizeobj) < ISC_OFFSET_MAXIMUM)
+ cfg_obj_asuint64(sizeobj) < maxoffset)
size = (isc_offset_t)cfg_obj_asuint64(sizeobj);
dest.file.stream = NULL;
dest.file.name = cfg_obj_asstring(pathobj);
memmove(addr, &sin->sin_addr, 4);
if ((plen % 8) != 0)
addr[addrl-1] &=
- ~0 << (8 - (plen % 8));
+ ~0U << (8 - (plen % 8));
} else {
family = 2;
sin6 = (struct sockaddr_in6 *) sa;
/* Mask off last address byte */
if (addrl > 0 && (plen % 8) != 0)
- addr[addrl - 1] &= ~0 << (8 - (plen % 8));
+ addr[addrl - 1] &= ~0U << (8 - (plen % 8));
/* family */
isc_buffer_putuint16(&b, family);
return (DNS_R_OPTERR);
if (addrbytes != 0U && (addrlen % 8) != 0) {
- isc_uint8_t bits = ~0 << (8 - (addrlen % 8));
+ isc_uint8_t bits = ~0U << (8 - (addrlen % 8));
bits &= sregion.base[addrbytes - 1];
if (bits != sregion.base[addrbytes - 1])
return (DNS_R_OPTERR);
return (1);
if (memcmp(addr, dest, mask / 8) == 0) {
- int n = mask / 8;
- int m = ((~0) << (8 - (mask % 8)));
+ u_int n = mask / 8;
+ u_int m = ((~0U) << (8 - (mask % 8)));
if ((mask % 8) == 0 ||
(((u_char *)addr)[n] & m) == (((u_char *)dest)[n] & m))
typedef off_t isc_offset_t;
-/*%
- * POSIX says "Additionally, blkcnt_t and off_t are extended signed integral
- * types", so the maximum value is all 1s except for the high bit.
- * This definition is more complex than it really needs to be because it was
- * crafted to keep both the SunOS 5.6 and the HP/UX 11 compilers quiet about
- * integer overflow. For example, though this is equivalent to just left
- * shifting 1 to the high bit and then inverting the bits, the SunOS compiler
- * is unhappy about shifting a positive "1" to negative in a signed integer.
- */
-#define ISC_OFFSET_MAXIMUM \
- (~(((off_t)-1 >> (sizeof(off_t) * CHAR_BIT - 1)) \
- << (sizeof(off_t) * CHAR_BIT - 1)))
-
#endif /* ISC_OFFSET_H */
typedef _off_t isc_offset_t;
-/*
- * POSIX says "Additionally, blkcnt_t and off_t are extended signed integral
- * types", so the maximum value is all 1s except for the high bit.
- * This definition is more complex than it really needs to be because it was
- * crafted to keep both the SunOS 5.6 and the HP/UX 11 compilers quiet about
- * integer overflow. For example, though this is equivalent to just left
- * shifting 1 to the high bit and then inverting the bits, the SunOS compiler
- * is unhappy about shifting a positive "1" to negative in a signed integer.
- */
-#define ISC_OFFSET_MAXIMUM \
- (~(((off_t)-1 >> (sizeof(off_t) * CHAR_BIT - 1)) \
- << (sizeof(off_t) * CHAR_BIT - 1)))
-
#endif /* ISC_OFFSET_H */