public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
* [PATCH] ip: Use regular htons() for non-constant protocol number in L2_BUF_IP4_PSUM
@ 2024-03-06  7:08 Stefano Brivio
  2024-03-08  0:55 ` David Gibson
  0 siblings, 1 reply; 4+ messages in thread
From: Stefano Brivio @ 2024-03-06  7:08 UTC (permalink / raw)
  To: passt-dev; +Cc: David Gibson, Laurent Vivier

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

Fixes: 5bf200ae8a1a ("tcp, udp: Don't include destination address in partially precomputed csums")
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
---
 ip.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ip.h b/ip.h
index 9be4778..b9aedf6 100644
--- a/ip.h
+++ b/ip.h
@@ -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)						\
 	{								\
-- 
@@ -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)						\
 	{								\
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-03-14  5:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-06  7:08 [PATCH] ip: Use regular htons() for non-constant protocol number in L2_BUF_IP4_PSUM Stefano Brivio
2024-03-08  0:55 ` David Gibson
2024-03-08  9:28   ` Stefano Brivio
2024-03-14  5:02     ` David Gibson

Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).