penalty
uint32_t penalty[sizeof(keylist) - 1][2];
uint32_t penalty; /* Its penalty. */
struct penalty *next;
struct penalty *p;
penalty[op][operand] += p->penalty = WRONGPENALTY;
struct penalty **pp, *p;
value = arc4random_uniform(maxval + penalty[op][operand]);
if (p->penalty > value) {
penalty[op][operand]--;
if (--(p->penalty) <= 0) {
value -= p->penalty;
penalty = loot = 0;
#define cashvalue (loot-penalty)/25
#define cashvalue chunk*(loot-penalty)/25
loot = loot - penalty;
penalty = 0;
penalty += loot / PENALTY;
if (loot >= penalty) {
int loot, penalty;
penalty_addr_cmp(struct penalty *a, struct penalty *b)
penalty_expiry_cmp(struct penalty *a, struct penalty *b)
struct penalty *penalty, *tmp;
RB_FOREACH_SAFE(penalty, penalties_by_expiry, by_expiry, tmp) {
if (penalty->expiry >= now)
penalty) != penalty ||
penalty) != penalty)
free(penalty);
struct penalty find, *penalty;
if ((penalty = RB_FIND(penalties_by_addr, by_addr, &find)) == NULL)
if (penalty->expiry < now) {
if (!penalty->active)
*reason = penalty->reason;
struct penalty *p = NULL;
struct penalty *penalty = NULL, *existing = NULL;
penalty = xcalloc(1, sizeof(*penalty));
penalty->addr = masked;
penalty->expiry = now + penalty_secs;
penalty->reason = reason;
penalty)) == NULL) {
penalty->active = 1;
if (RB_INSERT(penalties_by_expiry, by_expiry, penalty) != NULL)
do_log2_f(penalty->active ?
addrnetmask, penalty->active ? "active" : "deferred",
existing->reason = penalty->reason;
free(penalty);
penalty = NULL;
struct penalty *p = NULL;
RB_ENTRY(penalty) by_addr;
RB_ENTRY(penalty) by_expiry;
static int penalty_addr_cmp(struct penalty *a, struct penalty *b);
static int penalty_expiry_cmp(struct penalty *a, struct penalty *b);
RB_HEAD(penalties_by_addr, penalty) penalties_by_addr4, penalties_by_addr6;
RB_HEAD(penalties_by_expiry, penalty) penalties_by_expiry4, penalties_by_expiry6;
RB_GENERATE_STATIC(penalties_by_addr, penalty, by_addr, penalty_addr_cmp)
RB_GENERATE_STATIC(penalties_by_expiry, penalty, by_expiry, penalty_expiry_cmp)
mta_route_disable(struct mta_route *route, int penalty, int reason)
route->penalty += penalty;
delay = (unsigned long long)DELAY_ROUTE_BASE * route->penalty * route->penalty;
if (route->penalty) {
route->penalty -= 1;
route->penalty = 0;
if (r->penalty) {
delay = DELAY_ROUTE_BASE * r->penalty * r->penalty;
mta_route_to_text(r), (unsigned long long) sched - now, r->penalty);
route->penalty = 0;
route->penalty,
int penalty;