netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: dm@chelsio.com
Cc: xiaosuo@gmail.com, kuznet@ms2.inr.ac.ru, pekkas@netcore.fi,
	jmorris@namei.org, yoshfuji@linux-ipv6.org, kaber@trash.net,
	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 23:07:47 -0700 (PDT)	[thread overview]
Message-ID: <20100710.230747.258112764.davem@davemloft.net> (raw)
In-Reply-To: <4C394C5E.2000805@chelsio.com>

From: Dimitris Michailidis <dm@chelsio.com>
Date: Sat, 10 Jul 2010 21:45:18 -0700

> 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.

Agreed, Changli please make this change.

Thanky ou.

      reply	other threads:[~2010-07-11  6:07 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
2010-07-11  6:07   ` David Miller [this message]

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=20100710.230747.258112764.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=dm@chelsio.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).