mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-02 21:02:10 +00:00
Fix bug #55171: Binding UDP PCB with different IP type PCBs does not work
by additionally checking IP address type
(cherry picked from commit 2ff0db9a9b
)
This commit is contained in:
parent
7f53f7ced4
commit
bebf072b77
@ -997,8 +997,10 @@ udp_bind(struct udp_pcb *pcb, const ip_addr_t *ipaddr, u16_t port)
|
|||||||
{
|
{
|
||||||
/* port matches that of PCB in list and REUSEADDR not set -> reject */
|
/* port matches that of PCB in list and REUSEADDR not set -> reject */
|
||||||
if ((ipcb->local_port == port) &&
|
if ((ipcb->local_port == port) &&
|
||||||
|
(IP_GET_TYPE(&ipcb->local_ip) == IP_GET_TYPE(ipaddr)) &&
|
||||||
/* IP address matches or any IP used? */
|
/* IP address matches or any IP used? */
|
||||||
(ip_addr_cmp(&ipcb->local_ip, ipaddr) || ip_addr_isany(ipaddr) ||
|
(ip_addr_cmp(&ipcb->local_ip, ipaddr) ||
|
||||||
|
ip_addr_isany(ipaddr) ||
|
||||||
ip_addr_isany(&ipcb->local_ip))) {
|
ip_addr_isany(&ipcb->local_ip))) {
|
||||||
/* other PCB already binds to this local IP and port */
|
/* other PCB already binds to this local IP and port */
|
||||||
LWIP_DEBUGF(UDP_DEBUG,
|
LWIP_DEBUGF(UDP_DEBUG,
|
||||||
|
Loading…
Reference in New Issue
Block a user