upstream: a little more RB_TREE paranoia
OpenBSD-Commit-ID: 8dc2fd21eebd8830c4a4d25461ac4fe228e11156
This commit is contained in:
parent
fc4e96b217
commit
ef878d5879
|
@ -295,14 +295,14 @@ srclimit_remove_expired_penalties(void)
|
||||||
while (npenalties > (size_t)penalty_cfg.max_sources) {
|
while (npenalties > (size_t)penalty_cfg.max_sources) {
|
||||||
if ((p = RB_MIN(penalties_by_expiry,
|
if ((p = RB_MIN(penalties_by_expiry,
|
||||||
&penalties_by_expiry)) == NULL)
|
&penalties_by_expiry)) == NULL)
|
||||||
break; /* shouldn't happen */
|
fatal_f("internal error: penalty tables corrupt (find)");
|
||||||
bits = p->addr.af == AF_INET ? ipv4_masklen : ipv6_masklen;
|
bits = p->addr.af == AF_INET ? ipv4_masklen : ipv6_masklen;
|
||||||
addr_masklen_ntop(&p->addr, bits, s, sizeof(s));
|
addr_masklen_ntop(&p->addr, bits, s, sizeof(s));
|
||||||
debug3_f("overflow, remove %s", s);
|
debug3_f("overflow, remove %s", s);
|
||||||
if (RB_REMOVE(penalties_by_expiry,
|
if (RB_REMOVE(penalties_by_expiry,
|
||||||
&penalties_by_expiry, p) != p ||
|
&penalties_by_expiry, p) != p ||
|
||||||
RB_REMOVE(penalties_by_addr, &penalties_by_addr, p) != p)
|
RB_REMOVE(penalties_by_addr, &penalties_by_addr, p) != p)
|
||||||
fatal_f("internal error: penalty tables corrupt");
|
fatal_f("internal error: penalty tables corrupt (remove)");
|
||||||
free(p);
|
free(p);
|
||||||
npenalties--;
|
npenalties--;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue