Skip to contentSkip to conversation

Fix logic typo in cmp_secctx

PATCH Applied Thomas Jarosch 2 participants 2 messages Dec 27, 2012 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix logic typo in cmp_secctx

cppcheck reported:
[src/conntrack/compare.c:364] -> [src/conntrack/compare.c:364]: (style) Same expression on both sides of '||'.

---
 src/conntrack/compare.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/conntrack/compare.c +1 -1
index b18f7fc..e282a24 100644
@@ -361,7 +361,7 @@ cmp_secctx(const struct nf_conntrack *ct1,
 	   const struct nf_conntrack *ct2,
 	   unsigned int flags)
 {
-	if (ct1->secctx == NULL || ct1->secctx == NULL)
+	if (ct1->secctx == NULL || ct2->secctx == NULL)
 		return ct1->secctx == ct2->secctx;
 	return strcmp(ct1->secctx, ct2->secctx) == 0;
 }
Signature · 1 line
1.7.11.7
maintainer Applied
#1 lore raw
Quoted 13 lines · Thomas Jarosch

cppcheck reported:
[src/conntrack/compare.c:364] -> [src/conntrack/compare.c:364]: (style) Same expression on both sides of '||'.

---
 src/conntrack/compare.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/conntrack/compare.c +0 -0
index b18f7fc..e282a24 100644

src/conntrack/compare.c cmp_secctx(const struct nf_conntrack *ct1, · line 364

Quoted 5 lines
src/conntrack/compare.c +1 -1
@@ -361,7 +361,7 @@ cmp_secctx(const struct nf_conntrack *ct1,
 	   const struct nf_conntrack *ct2,
 	   unsigned int flags)
 {
-	if (ct1->secctx == NULL || ct1->secctx == NULL)
+	if (ct1->secctx == NULL || ct2->secctx == NULL)

Grrr, my fault.

Applied, thanks for fixing this.