public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch v2] openvswitch: using a bit shift as a mask
@ 2016-03-18 17:28 Dan Carpenter
  2016-03-19 12:09 ` Dan Carpenter
  2016-03-21 18:17 ` Jarno Rajahalme
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2016-03-18 17:28 UTC (permalink / raw)
  To: kernel-janitors

The original condition is never true.  We want to test if BIT(0) is set
but the code is ANDing with zero.

Fixes: 05752523e565 ('openvswitch: Interface with NAT.')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
v2: use test_bit() instead

diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c
index dc5eb29..9c9cac0 100644
--- a/net/openvswitch/conntrack.c
+++ b/net/openvswitch/conntrack.c
@@ -668,7 +668,7 @@ static int ovs_ct_nat(struct net *net, struct sw_flow_key *key,
 	 */
 	if (info->nat & OVS_CT_NAT && ctinfo != IP_CT_NEW &&
 	    ct->status & IPS_NAT_MASK &&
-	    (!(ct->status & IPS_EXPECTED_BIT) || info->commit)) {
+	    (!test_bit(IPS_EXPECTED_BIT, &ct->status) || info->commit)) {
 		/* NAT an established or related connection like before. */
 		if (CTINFO2DIR(ctinfo) = IP_CT_DIR_REPLY)
 			/* This is the REPLY direction for a connection

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [patch v2] openvswitch: using a bit shift as a mask
  2016-03-18 17:28 [patch v2] openvswitch: using a bit shift as a mask Dan Carpenter
@ 2016-03-19 12:09 ` Dan Carpenter
  2016-03-21 18:17 ` Jarno Rajahalme
  1 sibling, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2016-03-19 12:09 UTC (permalink / raw)
  To: kernel-janitors

It doesn't make sense to apply my patch.  Can you please send your patch
but give me a Reported-by: tag?

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch v2] openvswitch: using a bit shift as a mask
  2016-03-18 17:28 [patch v2] openvswitch: using a bit shift as a mask Dan Carpenter
  2016-03-19 12:09 ` Dan Carpenter
@ 2016-03-21 18:17 ` Jarno Rajahalme
  1 sibling, 0 replies; 3+ messages in thread
From: Jarno Rajahalme @ 2016-03-21 18:17 UTC (permalink / raw)
  To: kernel-janitors

I just sent the patch to netfilter-devel and kernel-janitors with you as Reported-by.

  Jarno

> On Mar 19, 2016, at 5:09 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> 
> It doesn't make sense to apply my patch.  Can you please send your patch
> but give me a Reported-by: tag?
> 
> regards,
> dan carpenter
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-21 18:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-18 17:28 [patch v2] openvswitch: using a bit shift as a mask Dan Carpenter
2016-03-19 12:09 ` Dan Carpenter
2016-03-21 18:17 ` Jarno Rajahalme

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox