diff options
author | Florian Westphal <fw@strlen.de> | 2019-05-20 07:48:10 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2019-05-21 14:20:40 -0400 |
commit | 6bac76db1da3cb162c425d58ae421486f8e43955 (patch) | |
tree | 110be51688911771d46771b72af8d4c96e1e1dbd /net | |
parent | 82ce6eb1dd13fd12e449b2ee2c2ec051e6f52c43 (diff) |
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.c | 2 |
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, | |||
170 | if (!udph->check && skb->ip_summed != CHECKSUM_PARTIAL) | 170 | if (!udph->check && skb->ip_summed != CHECKSUM_PARTIAL) |
171 | return true; | 171 | return true; |
172 | 172 | ||
173 | nf_nat_csum_recalc(skb, nf_ct_l3num(ct), IPPROTO_TCP, | 173 | nf_nat_csum_recalc(skb, nf_ct_l3num(ct), IPPROTO_UDP, |
174 | udph, &udph->check, datalen, oldlen); | 174 | udph, &udph->check, datalen, oldlen); |
175 | 175 | ||
176 | return true; | 176 | return true; |