<p dir="ltr"><br>
On Nov 16, 2012 7:46 PM, "Pavel Emelyanov" <<a href="mailto:xemul@parallels.com">xemul@parallels.com</a>> wrote:<br>
><br>
> On 11/16/2012 07:02 PM, Andrey Vagin wrote:<br>
> > A socket can get fin and a state will be changed on CLOSE_WAIT,<br>
> > which is not supported yet.<br>
> ><br>
> > Signed-off-by: Andrey Vagin <<a href="mailto:avagin@openvz.org">avagin@openvz.org</a>><br>
> > ---<br>
> > sk-tcp.c | 18 ++++++++++++++++++<br>
> > 1 file changed, 18 insertions(+)<br>
> ><br>
> > diff --git a/sk-tcp.c b/sk-tcp.c<br>
> > index 17f5ab2..2cbdb90 100644<br>
> > --- a/sk-tcp.c<br>
> > +++ b/sk-tcp.c<br>
> > @@ -54,6 +54,24 @@ static int tcp_repair_on(int fd)<br>
> > static int refresh_inet_sk(struct inet_sk_desc *sk)<br>
> > {<br>
> > int size;<br>
> > + struct tcp_info info;<br>
> > +<br>
> > + if (sk->state == TCP_CLOSE)<br>
> > + return 0;<br>
><br>
> Yet again -- how can this be true? This fn is called for establised<br>
> sockets only<br>
It's a copy past. Sorry again. Don't send patch at the last minute...<br>
><br>
> > +<br>
> > + if (dump_opt(sk->rfd, SOL_TCP, TCP_INFO, &info)) {<br>
> > + pr_perror("Failt to obtain TCP_INFO");<br>
> > + return -1;<br>
> > + }<br>
> > +<br>
> > + switch (info.tcpi_state) {<br>
> > + case TCP_ESTABLISHED:<br>
> > + case TCP_CLOSE:<br>
> > + break;<br>
> > + default:<br>
> > + pr_err("Unknown state %d\n", sk->state);<br>
> > + return -1;<br>
> > + }<br>
> ><br>
> > if (ioctl(sk->rfd, SIOCOUTQ, &size) == -1) {<br>
> > pr_perror("Unable to get size of snd queue");<br>
> ><br>
><br>
><br>
</p>