From dc882801bbab1a5ee6db10c98e9afad074d94059 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Sun, 4 Feb 2018 14:19:39 +0100 Subject: [PATCH] tcp: document TCP_EVENT_ERR exception for SYN_RCVD --- src/include/lwip/priv/tcp_priv.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/include/lwip/priv/tcp_priv.h b/src/include/lwip/priv/tcp_priv.h index 79f62618..ee7f9b35 100644 --- a/src/include/lwip/priv/tcp_priv.h +++ b/src/include/lwip/priv/tcp_priv.h @@ -177,6 +177,8 @@ err_t tcp_process_refused_data(struct tcp_pcb *pcb); ret = lwip_tcp_event((pcb)->callback_arg, (pcb), LWIP_EVENT_POLL, NULL, 0, ERR_OK); \ } else { \ ret = ERR_ARG; } } while(0) +/* For event API, last state SYN_RCVD must be excluded here: the application + has not seen this pcb, yet! */ #define TCP_EVENT_ERR(last_state,errf,arg,err) do { if (last_state != SYN_RCVD) { \ lwip_tcp_event((arg), NULL, LWIP_EVENT_ERR, NULL, 0, (err)); } } while(0)