diff --git a/src/core/tcp.c b/src/core/tcp.c index c98c43f5..dcf2495c 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -734,7 +734,11 @@ tcp_bind(struct tcp_pcb *pcb, const ip_addr_t *ipaddr, u16_t port) } } - if (!ip_addr_isany(ipaddr)) { + if (!ip_addr_isany(ipaddr) +#if LWIP_IPV4 && LWIP_IPV6 + || (IP_GET_TYPE(ipaddr) != IP_GET_TYPE(&pcb->local_ip)) +#endif /* LWIP_IPV4 && LWIP_IPV6 */ + ) { ip_addr_set(&pcb->local_ip, ipaddr); } pcb->local_port = port;