Skip to content

Commit

Permalink
daemon/defer: avoid warnings from gcc and coverity
Browse files Browse the repository at this point in the history
  • Loading branch information
vcunat committed Dec 30, 2024
1 parent d1b9ed9 commit 65bfaa9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions daemon/defer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 65bfaa9

Please sign in to comment.