Skip to contentSkip to conversation

openvswitch: using a bit shift as a mask

PATCH In review Dan Carpenter 2 participants 3 messages Mar 18, 2016 – Mar 21, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 openvswitch: using a bit shift as a mask

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.')

---
v2: use test_bit() instead

net/openvswitch/conntrack.c +1 -1
index dc5eb29..9c9cac0 100644
@@ -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
#1 lore raw

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

#2 lore raw
In reply to Dan Carpenter

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

Jarno

Quoted 8 lines · Dan Carpenter

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