tcp: Prevents a 0 sized (invalid) backlog

commit 44e1a2d8e2 accidently includes below changes in tcp_listen_with_backlog
 -  tcp_backlog_set(lpcb, backlog);
 +  lpcb->backlog = backlog;

Thus pass 0 to the backlog parameter of netconn_listen_with_backlog() fails.

Fixes: 44e1a2d8e2 ("define tcp_backlog_set() as dummy-define when backlog feature is disable")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: goldsimon <goldsimon@gmx.de>
This commit is contained in:
Axel Lin 2016-08-24 16:49:03 +08:00 committed by goldsimon
parent 298ec340e5
commit bf5866b27d

View File

@ -688,7 +688,7 @@ tcp_listen_with_backlog(struct tcp_pcb *pcb, u8_t backlog)
#endif /* LWIP_CALLBACK_API */
#if TCP_LISTEN_BACKLOG
lpcb->accepts_pending = 0;
lpcb->backlog = backlog;
tcp_backlog_set(lpcb, backlog);
#endif /* TCP_LISTEN_BACKLOG */
TCP_REG(&tcp_listen_pcbs.pcbs, (struct tcp_pcb *)lpcb);
return (struct tcp_pcb *)lpcb;