From 733758a9094920e5f8fbd7241613fbfc2a3ef8d8 Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Sun, 24 Jan 2016 00:42:52 +0100 Subject: [PATCH] tcp: fixed TCPH_UNSET_FLAG macro This macro is only used by VJ support in PPP and was always wrong since its introduction in commit e4a6d199fe. It's almost only used to clear the PSH TCP flag when necessary. This flag was probably less common about a decade ago so that would be the reason why it goes unnoticed for so long. Fixes: e4a6d199fe "Merged from DEVEL into main tree." Signed-off-by: Sylvain Rochet --- src/include/lwip/priv/tcp_priv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/include/lwip/priv/tcp_priv.h b/src/include/lwip/priv/tcp_priv.h index b7ea58b3..0ed616e2 100644 --- a/src/include/lwip/priv/tcp_priv.h +++ b/src/include/lwip/priv/tcp_priv.h @@ -186,7 +186,7 @@ PACK_STRUCT_END #define TCPH_HDRLEN_FLAGS_SET(phdr, len, flags) (phdr)->_hdrlen_rsvd_flags = htons(((len) << 12) | (flags)) #define TCPH_SET_FLAG(phdr, flags ) (phdr)->_hdrlen_rsvd_flags = ((phdr)->_hdrlen_rsvd_flags | htons(flags)) -#define TCPH_UNSET_FLAG(phdr, flags) (phdr)->_hdrlen_rsvd_flags = htons(ntohs((phdr)->_hdrlen_rsvd_flags) | (TCPH_FLAGS(phdr) & ~(flags)) ) +#define TCPH_UNSET_FLAG(phdr, flags) (phdr)->_hdrlen_rsvd_flags = ((phdr)->_hdrlen_rsvd_flags & ~htons(flags)) #define TCP_TCPLEN(seg) ((seg)->len + (((TCPH_FLAGS((seg)->tcphdr) & (TCP_FIN | TCP_SYN)) != 0) ? 1U : 0U))