From 1c0066afb3a1893b5459586195c00ff32211c88c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=89=E6=A0=BC=E6=96=AF?= Date: Wed, 23 Oct 2024 14:38:39 +0800 Subject: [PATCH] Zero checksum handling for UDP4->UDP6 MAP should be transparent to the UDP csum zero in both directions. --- nat46/modules/nat46-core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nat46/modules/nat46-core.c b/nat46/modules/nat46-core.c index 8d7f257..9e4f5fc 100644 --- a/nat46/modules/nat46-core.c +++ b/nat46/modules/nat46-core.c @@ -1766,6 +1766,11 @@ void ip6_update_csum(struct sk_buff * skb, struct ipv6hdr * ip6hdr, int do_atomi struct udphdr *udp = udp_hdr(skb); unsigned udplen = ntohs(ip6hdr->payload_len) - (do_atomic_frag?8:0); /* UDP hdr + payload */ + if ((udp->check == 0) && zero_csum_pass) { + /* zero checksum and the config to pass it is set - do nothing with it */ + break; + } + oldsum = udp->check; udp->check = 0;