]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
netfilter: nat: fix udp checksum corruption
authorFlorian Westphal <fw@strlen.de>
Mon, 20 May 2019 11:48:10 +0000 (13:48 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 21 May 2019 18:20:40 +0000 (20:20 +0200)
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>
net/netfilter/nf_nat_helper.c

index ccc06f7539d7e2a776fc8dce2ee94b531282ff5f..53aeb12b70fbaf2d9a178f41387f203875e60186 100644 (file)
@@ -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;