diff --git a/CHANGELOG b/CHANGELOG index f826cfb7..09c71af4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -204,6 +204,10 @@ HISTORY ++ Bug fixes: + 2007-06-13 Simon Goldschmidt + * netif.c: Fixed bug #20180 (TCP pcbs listening on IP_ADDR_ANY could get + changed in netif_set_ipaddr if previous netif->ip_addr.addr was 0. + 2007-06-13 Simon Goldschmidt * api_msg.c: pcb_new sets conn->err if protocol is not implemented -> netconn_new_..() does not allocate a new connection for unsupported diff --git a/src/core/netif.c b/src/core/netif.c index 6c87f2c0..073e99f8 100644 --- a/src/core/netif.c +++ b/src/core/netif.c @@ -251,7 +251,8 @@ netif_set_ipaddr(struct netif *netif, struct ip_addr *ipaddr) } for (lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) { /* PCB bound to current local interface address? */ - if (ip_addr_cmp(&(lpcb->local_ip), &(netif->ip_addr))) { + if ((!(ip_addr_isany(&(lpcb->local_ip)))) && + (ip_addr_cmp(&(lpcb->local_ip), &(netif->ip_addr)))) { /* The PCB is listening to the old ipaddr and * is set to listen to the new one instead */ ip_addr_set(&(lpcb->local_ip), ipaddr);