diff --git a/daemon/defer.c b/daemon/defer.c index 2718a6c65..4114564e9 100644 --- a/daemon/defer.c +++ b/daemon/defer.c @@ -302,6 +302,9 @@ static inline int classify(const union kr_sockaddr *addr, bool stream) } 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; @@ -461,6 +464,7 @@ static inline void process_single_deferred(void) 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; }