fixed bug #37969 SYN packet dropped as short packet in tcp_input function

This commit is contained in:
Simon Goldschmidt
2014-06-03 21:07:49 +02:00
parent 7fe7e1e984
commit 974f6982a1
3 changed files with 93 additions and 42 deletions

View File

@@ -298,22 +298,30 @@ struct tcp_seg {
struct tcp_hdr *tcphdr; /* the TCP header */
};
#define LWIP_TCP_OPT_LEN_MSS 4
#define LWIP_TCP_OPT_EOL 0
#define LWIP_TCP_OPT_NOP 1
#define LWIP_TCP_OPT_MSS 2
#define LWIP_TCP_OPT_WS 3
#define LWIP_TCP_OPT_TS 8
#define LWIP_TCP_OPT_LEN_MSS 4
#if LWIP_TCP_TIMESTAMPS
#define LWIP_TCP_OPT_LEN_TS 12
#define LWIP_TCP_OPT_LEN_TS 10
#define LWIP_TCP_OPT_LEN_TS_OUT 12 /* aligned for output (includes NOP padding) */
#else
#define LWIP_TCP_OPT_LEN_TS 0
#define LWIP_TCP_OPT_LEN_TS_OUT 0
#endif
#if LWIP_WND_SCALE
#define LWIP_TCP_OPT_LEN_WS 4
#define LWIP_TCP_OPT_LEN_WS 3
#define LWIP_TCP_OPT_LEN_WS_OUT 4 /* aligned for output (includes NOP padding) */
#else
#define LWIP_TCP_OPT_LEN_WS 0
#define LWIP_TCP_OPT_LEN_WS_OUT 0
#endif
#define LWIP_TCP_OPT_LENGTH(flags) \
(flags & TF_SEG_OPTS_MSS ? LWIP_TCP_OPT_LEN_MSS : 0) + \
(flags & TF_SEG_OPTS_TS ? LWIP_TCP_OPT_LEN_TS : 0) + \
(flags & TF_SEG_OPTS_WND_SCALE ? LWIP_TCP_OPT_LEN_WS : 0)
(flags & TF_SEG_OPTS_MSS ? LWIP_TCP_OPT_LEN_MSS : 0) + \
(flags & TF_SEG_OPTS_TS ? LWIP_TCP_OPT_LEN_TS_OUT : 0) + \
(flags & TF_SEG_OPTS_WND_SCALE ? LWIP_TCP_OPT_LEN_WS_OUT : 0)
/** This returns a TCP header option for MSS in an u32_t */
#define TCP_BUILD_MSS_OPTION(mss) htonl(0x02040000 | ((mss) & 0xFFFF))