All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dimitris Michailidis <dm@chelsio.com>
To: Changli Gao <xiaosuo@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
	"Pekka Savola (ipv6)" <pekkas@netcore.fi>,
	James Morris <jmorris@namei.org>,
	Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
	Patrick McHardy <kaber@trash.net>,
	Tom Herbert <therbert@google.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH] inet, inet6: make tcp_sendmsg() and tcp_sendpage() through inet_sendmsg() and inet_sendpage()
Date: Sat, 10 Jul 2010 21:45:18 -0700	[thread overview]
Message-ID: <4C394C5E.2000805@chelsio.com> (raw)
In-Reply-To: <1278819894-2861-1-git-send-email-xiaosuo@gmail.com>

Changli Gao wrote:

> diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
> index 3ceb025..1e5bad1 100644
> --- a/net/ipv4/af_inet.c
> +++ b/net/ipv4/af_inet.c
> @@ -727,28 +727,31 @@ int inet_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
>  	sock_rps_record_flow(sk);
>  
>  	/* We may need to bind the socket. */
> -	if (!inet_sk(sk)->inet_num && inet_autobind(sk))
> +	if (!sk->sk_prot->no_autobind &&
> +	    !inet_sk(sk)->inet_num && inet_autobind(sk))
>  		return -EAGAIN;

I think it's better to test inet_num first since usually it's not 0.  With 
the above ordering protocols with no_autobind==false end up making two 
comparisons.

  reply	other threads:[~2010-07-11  4:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-11  3:44 [PATCH] inet, inet6: make tcp_sendmsg() and tcp_sendpage() through inet_sendmsg() and inet_sendpage() Changli Gao
2010-07-11  4:45 ` Dimitris Michailidis [this message]
2010-07-11  6:07   ` David Miller

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=4C394C5E.2000805@chelsio.com \
    --to=dm@chelsio.com \
    --cc=davem@davemloft.net \
    --cc=jmorris@namei.org \
    --cc=kaber@trash.net \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=netdev@vger.kernel.org \
    --cc=pekkas@netcore.fi \
    --cc=therbert@google.com \
    --cc=xiaosuo@gmail.com \
    --cc=yoshfuji@linux-ipv6.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.