I'm having a problem with my stack port, where I have some test code
that is attempting to bind to a port. I'm getting an access violation
at an unexpected location, and am currently at a loss for what the cause
could be. Any pointers or ideas would be appreciated. From what it
looks like, the list of tcp_listen_pcbs has become corrupted somehow,
but I don't know of any likely candidates that would cause this.
Thanks!
err_t
tcp_bind(struct tcp_pcb *pcb, struct ip_addr *ipaddr, u16_t port)
{
struct tcp_pcb *cpcb;
if (port == 0) {
port = tcp_new_port();
}
/* Check if the address already is in use. */
/* Check the listen pcbs. */
for(cpcb = (struct tcp_pcb *)tcp_listen_pcbs.pcbs;
cpcb != NULL; cpcb = cpcb->next) {
-->if (cpcb->local_port == port) {<-- Crashes here
if (ip_addr_isany(&(cpcb->local_ip)) ||
ip_addr_isany(ipaddr) ||
ip_addr_cmp(&(cpcb->local_ip), ipaddr)) {
return ERR_USE;
}
}
}
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users