Patchwork [libnetfilter_conntrack] Fix logic typo in cmp_secctx

login
register
mail settings
Submitter Thomas Jarosch
Date Dec. 27, 2012, 2:12 p.m.
Message ID <4631253.eD7KB7KPU6@storm>
Download mbox | patch
Permalink /patch/208299/
State Accepted
Headers show

Comments

Thomas Jarosch - Dec. 27, 2012, 2:12 p.m.
cppcheck reported:
[src/conntrack/compare.c:364] -> [src/conntrack/compare.c:364]: (style) Same expression on both sides of '||'.

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
---
 src/conntrack/compare.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Florian Westphal - Dec. 27, 2012, 2:29 p.m.
Thomas Jarosch <thomas.jarosch@intra2net.com> wrote:
> cppcheck reported:
> [src/conntrack/compare.c:364] -> [src/conntrack/compare.c:364]: (style) Same expression on both sides of '||'.
> 
> Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
> ---
>  src/conntrack/compare.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/conntrack/compare.c b/src/conntrack/compare.c
> index b18f7fc..e282a24 100644
> --- a/src/conntrack/compare.c
> +++ b/src/conntrack/compare.c
> @@ -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.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/src/conntrack/compare.c b/src/conntrack/compare.c
index b18f7fc..e282a24 100644
--- a/src/conntrack/compare.c
+++ b/src/conntrack/compare.c
@@ -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;
 }