} else if (addr->ip.sa_family == AF_INET) {
memcpy(key, &addr->ip4.sin_addr, 4);
kru_conf = &V4_CONF;
+ } else {
+ kr_assert(false);
+ return PRIORITY_UDP; // shouldn't happen anyway
}
uint16_t load;
int i;
if (phase == PHASE_NON_UDP) {
for (; queue_ix < QUEUES_CNT && queue_len(queues[queue_ix]) == 0; queue_ix++);
- if (queue_ix >= PRIORITY_UDP) kr_assert(false);
+ if (kr_fails_assert(queue_ix < PRIORITY_UDP))
+ return NULL;
i = queue_ix;
} else {
i = PRIORITY_UDP;
int priority = classify((const union kr_sockaddr *)ctx->comm->src_addr, ctx->session->stream);
if (priority > queue_ix) { // priority dropped (got higher value)
VERBOSE_LOG(" PUSH to %d\n", priority);
+ kr_require(priority >= 0); // placate static analyzers; queue_ix can't be negative
push_query(ctx, priority, false);
return;
}