From b91b9d3d88bdc1bf6270ca82cd98966cf64e4ed5 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Sat, 30 Dec 2006 01:32:22 +0000 Subject: [PATCH] Use whole bytes for the ACKED and RCVD portions of tcp_state; it produces slightly smaller code. --- src/include/gpxe/tcp.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/include/gpxe/tcp.h b/src/include/gpxe/tcp.h index f0ac8ace..f9cd4139 100644 --- a/src/include/gpxe/tcp.h +++ b/src/include/gpxe/tcp.h @@ -58,15 +58,15 @@ struct tcp_header { * Note that this applies only to SYN and FIN. */ #define TCP_STATE_ACKED(flags) ( (flags) << 8 ) -#define TCP_FLAGS_ACKED(state) ( ( (state) >> 8 ) & 0x03 ) +#define TCP_FLAGS_ACKED(state) ( ( (state) >> 8 ) & 0xff ) /** TCP flags that have been received from the peer * * Note that this applies only to SYN and FIN, and that once SYN has * been received, we should always be sending ACK. */ -#define TCP_STATE_RCVD(flags) ( (flags) << 12 ) -#define TCP_FLAGS_RCVD(state) ( ( (state) >> 12 ) & 0x03 ) +#define TCP_STATE_RCVD(flags) ( (flags) << 16 ) +#define TCP_FLAGS_RCVD(state) ( ( (state) >> 16 ) & 0xff ) /** TCP flags that are currently being sent in outgoing packets */ #define TCP_FLAGS_SENDING(state) \