From caa22aa644cb56e6fda77ff80c62d038653f3cf9 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Tue, 25 Jan 2022 20:21:18 +0100 Subject: tcp, udp, util: Fixes for bitmap handling on big-endian, casts Bitmap manipulating functions would otherwise refer to inconsistent sets of bits on big-endian architectures. While at it, fix up a couple of casts. Signed-off-by: Stefano Brivio --- passt.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'passt.h') diff --git a/passt.h b/passt.h index ae3035f..0ef1897 100644 --- a/passt.h +++ b/passt.h @@ -67,7 +67,8 @@ extern char pkt_buf [PKT_BUF_BYTES]; extern char *ip_proto_str[]; #define IP_PROTO_STR(n) \ - (((n) <= IPPROTO_SCTP && ip_proto_str[(n)]) ? ip_proto_str[(n)] : "?") + (((uint8_t)(n) <= IPPROTO_SCTP && ip_proto_str[(n)]) ? \ + ip_proto_str[(n)] : "?") #include /* For MAXNS below */ -- cgit v1.2.3