From: Thomas Lamprecht Date: Tue, 13 Dec 2016 12:13:39 +0000 (+0100) Subject: fix ambiguous if statements X-Git-Url: https://git.proxmox.com/?p=pve-firewall.git;a=commitdiff_plain;h=0dc6e6387e38d51f07b57fdb3ddcf45d24ee92d8 fix ambiguous if statements the funciton nflog_bind_pf(...) returns an integer smaller 0 on a failure, we negated that which results in 1 if no failure and 0 if there was a failure. This is ambiguous and as no parenthesis are set the GCC 6 warning "logical-not-parentheses" gets triggered. Use a simple nflog_bind_pf(...) < 0 check instead. Signed-off-by: Thomas Lamprecht --- diff --git a/src/pvefw-logger.c b/src/pvefw-logger.c index 3b79ed1..3dc40eb 100644 --- a/src/pvefw-logger.c +++ b/src/pvefw-logger.c @@ -982,7 +982,7 @@ main(int argc, char *argv[]) exit(-1); } - if (!nflog_bind_pf(logh, AF_INET) <= 0) { + if (nflog_bind_pf(logh, AF_INET) < 0) { fprintf(stderr, "nflog_bind_pf AF_INET failed\n"); exit(-1); } @@ -994,7 +994,7 @@ main(int argc, char *argv[]) } #endif - if (!nflog_bind_pf(logh, AF_BRIDGE) <= 0) { + if (nflog_bind_pf(logh, AF_BRIDGE) < 0) { fprintf(stderr, "nflog_bind_pf AF_BRIDGE failed\n"); exit(-1); }