1
0
mirror of https://passt.top/passt synced 2024-12-22 05:35:23 +00:00

ip: Use regular htons() for non-constant protocol number in L2_BUF_IP4_PSUM

instead of htons_constant(), which is for... constants.

Fixes: 5bf200ae8a ("tcp, udp: Don't include destination address in partially precomputed csums")
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
Stefano Brivio 2024-03-05 22:50:22 +01:00
parent 137ce01789
commit 383a6f67e5

2
ip.h
View File

@ -38,7 +38,7 @@
.daddr = 0, \
}
#define L2_BUF_IP4_PSUM(proto) ((uint32_t)htons_constant(0x4500) + \
(uint32_t)htons_constant(0xff00 | (proto)))
(uint32_t)htons(0xff00 | (proto)))
#define L2_BUF_IP6_INIT(proto) \
{ \