mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-19 23:12:09 +00:00
Fixed bug #41700 (Call to tcp_listen_dual() should not accept IPv4 listen PCB args)
This commit is contained in:
parent
2aabe16163
commit
a6a92d42f9
@ -591,6 +591,21 @@ struct tcp_pcb *
|
||||
tcp_listen_dual_with_backlog(struct tcp_pcb *pcb, u8_t backlog)
|
||||
{
|
||||
struct tcp_pcb *lpcb;
|
||||
struct tcp_pcb_listen *l;
|
||||
|
||||
/* Dual listen only works on bound pcbs (or else we cannot check for
|
||||
duplicate port use. */
|
||||
if (pcb->local_port == 0) {
|
||||
return NULL;
|
||||
}
|
||||
/* Check that there's noone listening on this port already
|
||||
(don't check the IP address since we'll set it to ANY */
|
||||
for(l = tcp_listen_pcbs.listen_pcbs; l != NULL; l = l->next) {
|
||||
if (l->local_port == pcb->local_port) {
|
||||
/* this port is already used */
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
lpcb = tcp_listen_with_backlog(pcb, backlog);
|
||||
if ((lpcb != NULL) &&
|
||||
|
Loading…
Reference in New Issue
Block a user