lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tcp_close: pcb->state - WAS: [lwip-users] portscan


From: Kieran Mansley
Subject: Re: tcp_close: pcb->state - WAS: [lwip-users] portscan
Date: Wed, 01 Jul 2009 11:53:36 +0100

On Wed, 2009-07-01 at 11:40 +0200, Bernhard 'Gustl' Bauer wrote:
> Hi,
> 
> I finally made some progress in my portscan problem.
> 
> When I send out data, I get http_sent() calls. If all data is sent out I 
> call a tcp_close(). Unfortunately pcb->state is either ESTABLISHED or 
> CLOSE_WAIT and neither does free tcp_pcb.

That's odd.  Is this the state before or after you've called tcp_close
()?  If you've called tcp_close() it should be in FIN_WAIT1, FIN_WAIT2,
CLOSING, or TIME_WAIT on its way to CLOSED.  CLOSE_WAIT is entered if
the other end closes the connection first, and then when you call
tcp_close() it should move to LAST_ACK and then CLOSED. 

> One solution could be to use tcp_abort(). Another to set state to CLOSED 
> or SYN_SENT. How to do it right?

tcp_close() is the right way to do it, but why the state is as you
describe I'm not sure.

Kieran





reply via email to

[Prev in Thread] Current Thread [Next in Thread]