tayga: refresh patch

Refreshed patch
 - 002-bigendian_wrong_checksum.patch

Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
This commit is contained in:
Goetz Goerisch
2025-07-22 20:01:44 +02:00
committed by Josef Schlehofer
parent 39d9a5fd03
commit a09c2777a8

View File

@@ -1,8 +1,8 @@
--- a/nat64.c --- a/nat64.c
+++ b/nat64.c +++ b/nat64.c
@@ -19,6 +19,11 @@ @@ -129,6 +129,11 @@ static void log_pkt6(int err, struct pkt
type, saddr, daddr, (p->header_len + p->data_len),p->data_proto,msg);
extern struct config *gcfg; }
+static uint16_t checksum_extend_byte(uint8_t b) +static uint16_t checksum_extend_byte(uint8_t b)
+{ +{
@@ -12,7 +12,7 @@
static uint16_t ip_checksum(void *d, int c) static uint16_t ip_checksum(void *d, int c)
{ {
uint32_t sum = 0xffff; uint32_t sum = 0xffff;
@@ -30,7 +35,7 @@ static uint16_t ip_checksum(void *d, int @@ -140,7 +145,7 @@ static uint16_t ip_checksum(void *d, int
} }
if (c) if (c)
@@ -21,7 +21,7 @@
while (sum > 0xffff) while (sum > 0xffff)
sum = (sum & 0xffff) + (sum >> 16); sum = (sum & 0xffff) + (sum >> 16);
@@ -180,10 +185,12 @@ static int xlate_payload_4to6(struct pkt @@ -296,10 +301,12 @@ static int xlate_payload_4to6(struct pkt
cksum = ones_add(p->icmp->cksum, cksum); cksum = ones_add(p->icmp->cksum, cksum);
if (p->icmp->type == 8) { if (p->icmp->type == 8) {
p->icmp->type = 128; p->icmp->type = 128;
@@ -34,9 +34,9 @@
+ p->icmp->cksum = ones_add(cksum, + p->icmp->cksum = ones_add(cksum,
+ ~checksum_extend_byte(129 - 0)); + ~checksum_extend_byte(129 - 0));
} }
return 0; return ERROR_NONE;
case 17: /* UDP */
@@ -668,10 +675,12 @@ static int xlate_payload_6to4(struct pkt @@ -892,10 +899,12 @@ static int xlate_payload_6to4(struct pkt
cksum = ones_add(p->icmp->cksum, cksum); cksum = ones_add(p->icmp->cksum, cksum);
if (p->icmp->type == 128) { if (p->icmp->type == 128) {
p->icmp->type = 8; p->icmp->type = 8;
@@ -49,5 +49,5 @@
+ p->icmp->cksum = ones_add(cksum, + p->icmp->cksum = ones_add(cksum,
+ checksum_extend_byte(129 - 0)); + checksum_extend_byte(129 - 0));
} }
return 0; return ERROR_NONE;
case 17: /* UDP */