3260. [bug] "rrset-order cyclic" could appear to not rotate

for some query patterns.  [RT #27170]
This commit is contained in:
Mark Andrews
2011-12-22 23:55:25 +00:00
parent f2926b876c
commit ecfec45175
2 changed files with 14 additions and 1 deletions

View File

@@ -1,3 +1,6 @@
3260. [bug] "rrset-order cyclic" could appear to not rotate
for some query patterns. [RT #27170]
3259. [bug] named-compilezone: Suppress "dump zone to <file>"
message when writing to stdout. [RT #27109]

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rbtdb.c,v 1.270.12.38 2011/12/07 22:27:21 marka Exp $ */
/* $Id: rbtdb.c,v 1.270.12.39 2011/12/22 23:55:25 marka Exp $ */
/*! \file */
@@ -2697,6 +2697,14 @@ zone_zonecut_callback(dns_rbtnode_t *node, dns_name_t *name, void *arg) {
return (result);
}
static inline unsigned int
prand(isc_uint32_t val) {
val ^= val >> 16;
val ^= val >> 8;
val ^= val >> 4;
return (val & 0xf);
}
static inline void
bind_rdataset(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node,
rdatasetheader_t *header, isc_stdtime_t now,
@@ -2736,6 +2744,8 @@ bind_rdataset(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node,
raw = (unsigned char *)header + sizeof(*header);
rdataset->private3 = raw;
rdataset->count = header->count++;
/* Add a weak pseudo random value [0..15]. */
header->count += prand(header->count);
if (rdataset->count == ISC_UINT32_MAX)
rdataset->count = 0;