Browse Source

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.

STABLE-2_1_x
goldsimon 19 years ago
parent
commit
cbf281589b
  1. 4
      CHANGELOG
  2. 3
      src/core/netif.c

4
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

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

Loading…
Cancel
Save