[CRIU] [PATCH] tcp: check a state in refresh_inet_sk

Andrey Wagin avagin at gmail.com
Fri Nov 16 13:04:06 EST 2012


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


More information about the CRIU mailing list