On Tue, 2007-04-17 at 13:25 +0200, Goldschmidt Simon wrote: > > > Also I am getting the following Messages: (I have some debugging > > > turned on). > > > > > > tpc_listen_input: ACK in LISTEN, sending reset. > > > tcp_rst: seqno 5984823 ackno 3514939349. > > > > This suggests that packets are being sent or delivered to the > > listening socket when there should obviously be none other > > than SYNs going there. > > If you can get a packet capture of one of these that might > > through some light on it. > > Could it be that the same pcb was set to listening state through > tcp_listen() and at > the same time (the same pcb) was used to connect somewhere (using > tcp_connect())?
I think it more likely that it is two separate PCBs, but they both have the same local port. This is quite common: when doing a passive open (i.e. at the listening end of a TCP connection), the listening PCB spawns a new "data transfer" PCB that has the same local address and port. This is OK because they will all have different remote addresses/ports and so can be told apart. When the data transfer PCB is finished and closed however, only the listening PCB will be left on that local port, and so it will receive any packets that were in fact destined for the data PCB. Things like the TIME_WAIT state are designed to protect against this causing too many problems, but there can still be occasions where a packet ends up getting through. This is why the listening PCB sends a RST to the other end when it receives the packet - it knows that the connection it was for is long gone, and so a RST should get the other end to notice. Kieran _______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users
