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.

This commit is contained in:
goldsimon 2007-06-16 13:32:10 +00:00
parent f1d95379bc
commit cbf281589b
2 changed files with 6 additions and 1 deletions

View File

@ -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

View File

@ -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);