Skip to content

Commit

Permalink
netfilter: nat: never update the UDP checksum when it's 0
Browse files Browse the repository at this point in the history
(bsc#1176447).

suse-commit: d8ede2a6011026df730f4dfbcb94d14f999c615a
  • Loading branch information
Thomas Bogendoerfer committed Sep 28, 2020
1 parent b395419 commit 3dc74ef
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions net/netfilter/nf_nat_proto.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,13 @@ static bool udp_manip_pkt(struct sk_buff *skb,
enum nf_nat_manip_type maniptype)
{
struct udphdr *hdr;
bool do_csum;

if (skb_ensure_writable(skb, hdroff + sizeof(*hdr)))
return false;

hdr = (struct udphdr *)(skb->data + hdroff);
do_csum = hdr->check || skb->ip_summed == CHECKSUM_PARTIAL;
__udp_manip_pkt(skb, iphdroff, hdr, tuple, maniptype, !!hdr->check);

__udp_manip_pkt(skb, iphdroff, hdr, tuple, maniptype, do_csum);
return true;
}

Expand Down

0 comments on commit 3dc74ef

Please sign in to comment.