socket: fix severity check in debug logging

Don't waste time formatting the debug message in log_message() when
debug output is disabled.

Fixes: 86a3ef9ed1 ("socket: add new socket support")
This commit is contained in:
Miroslav Lichvar 2020-03-24 15:29:21 +01:00
parent 8bab35c122
commit cfa39af345

View file

@ -613,7 +613,7 @@ log_message(int sock_fd, int direction, SCK_Message *message, const char *prefix
const char *local_addr, *remote_addr;
char if_index[20], tss[10], tsif[20], tslen[20];
if (DEBUG <= 0 || log_min_severity < LOGS_DEBUG)
if (DEBUG <= 0 || log_min_severity > LOGS_DEBUG)
return;
remote_addr = NULL;