Linux Container Development
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Cc: containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org
Subject: Re: [PATCH] Remove some unnecessary checks on socket restart
Date: Thu, 1 Oct 2009 16:47:49 -0500	[thread overview]
Message-ID: <20091001214749.GA4343@us.ibm.com> (raw)
In-Reply-To: <1254433228-20882-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

Quoting Dan Smith (danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org):
> These two checks are removed because they cannot be true because of the
> unsigned nature of the values being examined
> 
> Signed-off-by: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> Cc: serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org
> Cc: orenl-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org
> ---
>  net/checkpoint.c |    6 ++----
>  1 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/net/checkpoint.c b/net/checkpoint.c
> index a11ec7a..017c7f8 100644
> --- a/net/checkpoint.c
> +++ b/net/checkpoint.c
> @@ -480,12 +480,10 @@ static int sock_cptrst(struct ckpt_ctx *ctx, struct sock *sk,
>  		ckpt_debug("socket/sock in inconsistent state: %i/%i",
>  			   h->socket.state, h->sock.state);
>  		return -EINVAL;
> -	} else if ((h->sock.state < TCP_ESTABLISHED) ||
> -		   (h->sock.state >= TCP_MAX_STATES)) {
> +	} else if (h->sock.state >= TCP_MAX_STATES) {

No, TCP_ESTABLISHED is defined to 1 isn't it?

>  		ckpt_debug("sock in invalid state: %i", h->sock.state);
>  		return -EINVAL;
> -	} else if ((h->socket.state < SS_FREE) ||
> -		   (h->socket.state > SS_DISCONNECTING)) {
> +	} else if (h->socket.state > SS_DISCONNECTING) {

Yes, thanks.

>  		ckpt_debug("socket in invalid state: %i",
>  			   h->socket.state);
>  		return -EINVAL;
> -- 
> 1.6.0.4

  parent reply	other threads:[~2009-10-01 21:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-01 21:40 [PATCH] Remove some unnecessary checks on socket restart Dan Smith
     [not found] ` <1254433228-20882-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-10-01 21:47   ` Serge E. Hallyn [this message]
     [not found]     ` <20091001214749.GA4343-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-10-01 22:01       ` Dan Smith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091001214749.GA4343@us.ibm.com \
    --to=serue-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
    --cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
    --cc=danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox