mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-05 22:29:49 +00:00
tcp_accepted(): check pcb state to verify it isn't called on a connection-pcb
This commit is contained in:
parent
92beddd72f
commit
43a08bef14
@ -328,9 +328,12 @@ void tcp_err (struct tcp_pcb *pcb, tcp_err_fn err);
|
|||||||
#define tcp_nagle_disabled(pcb) (((pcb)->flags & TF_NODELAY) != 0)
|
#define tcp_nagle_disabled(pcb) (((pcb)->flags & TF_NODELAY) != 0)
|
||||||
|
|
||||||
#if TCP_LISTEN_BACKLOG
|
#if TCP_LISTEN_BACKLOG
|
||||||
#define tcp_accepted(pcb) (((struct tcp_pcb_listen *)(pcb))->accepts_pending--)
|
#define tcp_accepted(pcb) do { \
|
||||||
|
LWIP_ASSERT("pcb->state == LISTEN (called for wrong pcb?)", pcb->state == LISTEN); \
|
||||||
|
(((struct tcp_pcb_listen *)(pcb))->accepts_pending--); } while(0)
|
||||||
#else /* TCP_LISTEN_BACKLOG */
|
#else /* TCP_LISTEN_BACKLOG */
|
||||||
#define tcp_accepted(pcb) LWIP_UNUSED_ARG(pcb);
|
#define tcp_accepted(pcb) LWIP_ASSERT("pcb->state == LISTEN (called for wrong pcb?)", \
|
||||||
|
pcb->state == LISTEN)
|
||||||
#endif /* TCP_LISTEN_BACKLOG */
|
#endif /* TCP_LISTEN_BACKLOG */
|
||||||
|
|
||||||
void tcp_recved (struct tcp_pcb *pcb, u16_t len);
|
void tcp_recved (struct tcp_pcb *pcb, u16_t len);
|
||||||
|
Loading…
Reference in New Issue
Block a user