From: Jan Engelhardt Date: Thu, 15 Jun 2017 10:00:09 +0000 (+0200) Subject: xt_LOGMARK: resolve new gcc7 warnings X-Git-Tag: v2.13~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=21ea7b76ec3ea1ca366685b0a7500e60a942276e;p=thirdparty%2Fxtables-addons.git xt_LOGMARK: resolve new gcc7 warnings xt_LOGMARK.c:56:32: warning: increment of a boolean expression [-Wbool-operation] printk("%s""SEEN_REPLY", prev++ ? "," : ""); xt_LOGMARK.c:58:29: warning: increment of a boolean expression [-Wbool-operation] printk("%s""ASSURED", prev++ ? "," : ""); xt_LOGMARK.c:60:31: warning: increment of a boolean expression [-Wbool-operation] printk("%s""CONFIRMED", prev++ ? "," : ""); --- diff --git a/extensions/xt_LOGMARK.c b/extensions/xt_LOGMARK.c index 6c00d1d..38d96d3 100644 --- a/extensions/xt_LOGMARK.c +++ b/extensions/xt_LOGMARK.c @@ -52,12 +52,18 @@ static void logmark_ct(const struct nf_conn *ct, enum ip_conntrack_info ctinfo) printk("EXPECTED"); prev = true; } - if (ct->status & IPS_SEEN_REPLY) - printk("%s""SEEN_REPLY", prev++ ? "," : ""); - if (ct->status & IPS_ASSURED) - printk("%s""ASSURED", prev++ ? "," : ""); - if (ct->status & IPS_CONFIRMED) - printk("%s""CONFIRMED", prev++ ? "," : ""); + if (ct->status & IPS_SEEN_REPLY) { + printk("%s""SEEN_REPLY", prev ? "," : ""); + prev = true; + } + if (ct->status & IPS_ASSURED) { + printk("%s""ASSURED", prev ? "," : ""); + prev = true; + } + if (ct->status & IPS_CONFIRMED) { + printk("%s""CONFIRMED", prev ? "," : ""); + prev = true; + } #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0) printk(" lifetime=%lus", nf_ct_expires(ct) / HZ); #else