This is what I did:
for (lpcb = tcp_listen_pcbs; lpcb != NULL; lpcb = lpcb->next) {
/* PCB listening to a specific address? - JG - added for DHCP */
if (! ip_addr_isany(&(lpcb->local_ip))) {
/* PCB bound to current local interface address? */
if (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
* TODO: how do we know it is _listening_? */
ip_addr_set(&(lpcb->local_ip), ipaddr);
}
}
}
It solved the problem that I was concerned about, namely changing a pcb
from listening to any IP address to listening to a specific IP
address. There may well be situations where this is inappropriate. I
hope that a solution satisfactory to all can be found.
Leon Woestenberg wrote:
Hello Jim,
Jim Gibbons wrote:
I haven't checked the CVS head, but in version 1.1.0, there seems to
be a problem in the processing of the listening pcb's.
There is a loop that tries to correct these pcb's if their IP address
has changed. The problem is that there is no check to see if the
listening pcb doesn't care about the address. Normally, this will
cause no problems. It takes some pretty elaborate circumstances
(involving DHCP on two or more interfaces and listening before the
DHCP address is acquired) for this to be an issue. Nevertheless, I
think it is wrong in principal to change a pcb from listening on any
IP address to listening on a specific one.
Have I missed something?
No, you found a bug. I am not sure for the proper fix though. Should
UDP PCBs listening to the former netif IP address be listening to the
new netif IP address? And TCP?
Anyone?
Regards,
Leon.
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users