From 486fba5505fc0c579321fd8cc125bac8058d197f Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Tue, 8 Aug 2023 18:37:53 +0200 Subject: net_io: Fix long / int confusion In network terms, long is 32bit, i.e. an int for us. --- device/net_io.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/device/net_io.c b/device/net_io.c index cabb1be9..ee9435d7 100644 --- a/device/net_io.c +++ b/device/net_io.c @@ -1570,17 +1570,17 @@ net_io_init(void) #ifndef BPF_ALIGN #define EXTRACT_SHORT(p) ((u_short)ntohs(*(u_short *)p)) -#define EXTRACT_LONG(p) (ntohl(*(u_long *)p)) +#define EXTRACT_LONG(p) (ntohl(*(u_int *)p)) #else #define EXTRACT_SHORT(p)\ ((u_short)\ ((u_short)*((u_char *)p+0)<<8|\ (u_short)*((u_char *)p+1)<<0)) #define EXTRACT_LONG(p)\ - ((u_long)*((u_char *)p+0)<<24|\ - (u_long)*((u_char *)p+1)<<16|\ - (u_long)*((u_char *)p+2)<<8|\ - (u_long)*((u_char *)p+3)<<0) + ((u_int)*((u_char *)p+0)<<24|\ + (u_int)*((u_char *)p+1)<<16|\ + (u_int)*((u_char *)p+2)<<8|\ + (u_int)*((u_char *)p+3)<<0) #endif /* -- cgit v1.2.3