mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-27 21:35:48 +00:00
tcp: Make tcp_listen_with_backlog_and_err return NULL if the address/port is already used
The caller of tcp_listen_with_backlog_and_err() usually check if the return pcb is NULL before checking the err reason. I think the commit adding tcp_listen_with_backlog_and_err() accidently change the behavior, Fix it. Fixes: 98fc82fa7128 ("added function tcp_listen_with_backlog_and_err() to get the error reason when listening fails") Signed-off-by: Axel Lin <axel.lin@ingics.com>
This commit is contained in:
parent
edfeab7932
commit
1f3c18fcbe
@ -684,6 +684,7 @@ tcp_listen_with_backlog_and_err(struct tcp_pcb *pcb, u8_t backlog, err_t *err)
|
||||
if ((lpcb->local_port == pcb->local_port) &&
|
||||
ip_addr_cmp(&lpcb->local_ip, &pcb->local_ip)) {
|
||||
/* this address/port is already used */
|
||||
lpcb = NULL;
|
||||
res = ERR_USE;
|
||||
goto done;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user