Skip to contentSkip to conversation

netfilter: nf_nat_snmp_basic: fix duplicates in if/else branches

PATCH Applied Francois-Xavier Le Bail 3 participants 3 messages Feb 11, 2014 – Feb 14, 2014

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

PATCH 1/1 netfilter: nf_nat_snmp_basic: fix duplicates in if/else branches

The solution was found by Patrick in 2.4 kernel sources.

---
 net/ipv4/netfilter/nf_nat_snmp_basic.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/ipv4/netfilter/nf_nat_snmp_basic.c +2 -2
index d551e31..7c67667 100644
@@ -1198,8 +1198,8 @@ static int snmp_translate(struct nf_conn *ct,
 		map.to = NOCT1(&ct->tuplehash[!dir].tuple.dst.u3.ip);
 	} else {
 		/* DNAT replies */
-		map.from = NOCT1(&ct->tuplehash[dir].tuple.src.u3.ip);
-		map.to = NOCT1(&ct->tuplehash[!dir].tuple.dst.u3.ip);
+		map.from = NOCT1(&ct->tuplehash[!dir].tuple.src.u3.ip);
+		map.to = NOCT1(&ct->tuplehash[dir].tuple.dst.u3.ip);
 	}
 
 	if (map.from == map.to)
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Francois-Xavier Le Bail

The solution was found by Patrick in 2.4 kernel sources.

Cc Patrick McHardy <[email protected]>
Quoted 26 lines

---
net/ipv4/netfilter/nf_nat_snmp_basic.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
net/ipv4/netfilter/nf_nat_snmp_basic.c +2 -3
index d551e31..7c67667 100644
@@ -1198,8 +1198,8 @@ static int snmp_translate(struct nf_conn *ct,
 		map.to = NOCT1(&ct->tuplehash[!dir].tuple.dst.u3.ip);
 	} else {
 		/* DNAT replies */
-		map.from = NOCT1(&ct->tuplehash[dir].tuple.src.u3.ip);
-		map.to = NOCT1(&ct->tuplehash[!dir].tuple.dst.u3.ip);
+		map.from = NOCT1(&ct->tuplehash[!dir].tuple.src.u3.ip);
+		map.to = NOCT1(&ct->tuplehash[dir].tuple.dst.u3.ip);
 	}
 
 	if (map.from == map.to)
--

To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html