tcp/udp_netif_ipv4_addr_changed(): don't change specific-address of local tcp_listen/udp_pcb to ANY on address change

This commit is contained in:
sg 2015-03-06 20:25:51 +01:00
parent df16a7c4f3
commit 553c4203ab
2 changed files with 16 additions and 14 deletions

View File

@ -1843,13 +1843,13 @@ void tcp_netif_ipv4_addr_changed(const ip_addr_t* old_addr, const ip_addr_t* new
tcp_netif_ipv4_addr_changed_pcblist(old_addr, tcp_active_pcbs);
tcp_netif_ipv4_addr_changed_pcblist(old_addr, tcp_bound_pcbs);
if (!ip_addr_isany(new_addr)) {
/* PCB bound to current local interface address? */
for (lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = next) {
next = lpcb->next;
/* PCB bound to current local interface address? */
if ((!(ip_addr_isany(ipX_2_ip(&lpcb->local_ip)))) &&
(ip_addr_cmp(ipX_2_ip(&lpcb->local_ip), old_addr))) {
if (new_addr != NULL) {
/* The PCB is listening to the old ipaddr and
* is set to listen to the new one instead */
ip_addr_set(ipX_2_ip(&lpcb->local_ip), new_addr);

View File

@ -1160,6 +1160,7 @@ void udp_netif_ipv4_addr_changed(const ip_addr_t* old_addr, const ip_addr_t* new
{
struct udp_pcb* upcb;
if (!ip_addr_isany(new_addr)) {
for (upcb = udp_pcbs; upcb != NULL; upcb = upcb->next) {
/* PCB bound to current local interface address? */
if ((!(ip_addr_isany(ipX_2_ip(&upcb->local_ip)))) &&
@ -1170,6 +1171,7 @@ void udp_netif_ipv4_addr_changed(const ip_addr_t* old_addr, const ip_addr_t* new
}
}
}
}
#if UDP_DEBUG
/**