From 6e249d943dcd659884eb5c2b1e8365921537fde8 Mon Sep 17 00:00:00 2001 From: Naseefabu Date: Sat, 11 Oct 2025 08:01:34 +0000 Subject: [PATCH 1/2] Fix UDP payload pointer calculation: use correct struct size for udp header --- src/include/zf_internal/private/zf_stack_rx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/include/zf_internal/private/zf_stack_rx.h b/src/include/zf_internal/private/zf_stack_rx.h index d121828..b8b83cf 100644 --- a/src/include/zf_internal/private/zf_stack_rx.h +++ b/src/include/zf_internal/private/zf_stack_rx.h @@ -398,7 +398,7 @@ zf_stack_handle_rx_udp(struct zf_stack* st, const char* iov_base, if(ZF_UNLIKELY( rc < 0 )) goto receive_error; - return __zf_stack_handle_rx_udp(st, udp_rx, ((char*)udp) + sizeof(udp), + return __zf_stack_handle_rx_udp(st, udp_rx, ((char*)udp) + sizeof(udphdr), tot_len - (ip->ihl*4) - sizeof(udp)) || rc; } From 593bfe176133fbae1abc4e7aec6d69fd1c003454 Mon Sep 17 00:00:00 2001 From: Naseefabu Date: Sat, 11 Oct 2025 08:27:40 +0000 Subject: [PATCH 2/2] repeat of the same --- src/include/zf_internal/private/zf_stack_rx.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/include/zf_internal/private/zf_stack_rx.h b/src/include/zf_internal/private/zf_stack_rx.h index b8b83cf..501f258 100644 --- a/src/include/zf_internal/private/zf_stack_rx.h +++ b/src/include/zf_internal/private/zf_stack_rx.h @@ -383,7 +383,7 @@ zf_stack_handle_rx_udp(struct zf_stack* st, const char* iov_base, st->pftf.w = &udp_rx->w; st->pftf.frame_len = frame_len; - st->pftf.payload_len = tot_len - (ip->ihl*4) - sizeof(udp); + st->pftf.payload_len = tot_len - (ip->ihl*4) - sizeof(udphdr); st->pftf.copied_payload = (char*) (udp + 1); st->pftf.payload += (char*) (udp + 1) - iov_base; zf_log_udp_rx_trace(udp_rx, "%s: PFTF %x data %p len %d\n", __func__, @@ -400,7 +400,7 @@ zf_stack_handle_rx_udp(struct zf_stack* st, const char* iov_base, return __zf_stack_handle_rx_udp(st, udp_rx, ((char*)udp) + sizeof(udphdr), tot_len - (ip->ihl*4) - - sizeof(udp)) || rc; + sizeof(udphdr)) || rc; } /* No match. Wait for it to appear from the future if necessary before