summary refs log tree commit diff
path: root/net
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2019-05-20 13:48:10 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2019-05-21 20:20:40 +0200
commit6bac76db1da3cb162c425d58ae421486f8e43955 (patch)
tree110be51688911771d46771b72af8d4c96e1e1dbd /net
parent82ce6eb1dd13fd12e449b2ee2c2ec051e6f52c43 (diff)
downloadlinux-6bac76db1da3cb162c425d58ae421486f8e43955.tar.gz
netfilter: nat: fix udp checksum corruption
Due to copy&paste error nf_nat_mangle_udp_packet passes IPPROTO_TCP,
resulting in incorrect udp checksum when payload had to be mangled.

Fixes: dac3fe72596f9 ("netfilter: nat: remove csum_recalc hook")
Reported-by: Marc Haber <mh+netdev@zugschlus.de>
Tested-by: Marc Haber <mh+netdev@zugschlus.de>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/nf_nat_helper.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/nf_nat_helper.c b/net/netfilter/nf_nat_helper.c
index ccc06f7539d7..53aeb12b70fb 100644
--- a/net/netfilter/nf_nat_helper.c
+++ b/net/netfilter/nf_nat_helper.c
@@ -170,7 +170,7 @@ nf_nat_mangle_udp_packet(struct sk_buff *skb,
 	if (!udph->check && skb->ip_summed != CHECKSUM_PARTIAL)
 		return true;
 
-	nf_nat_csum_recalc(skb, nf_ct_l3num(ct), IPPROTO_TCP,
+	nf_nat_csum_recalc(skb, nf_ct_l3num(ct), IPPROTO_UDP,
 			   udph, &udph->check, datalen, oldlen);
 
 	return true;