lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20100710.230747.258112764.davem@davemloft.net>
Date:	Sat, 10 Jul 2010 23:07:47 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	dm@...lsio.com
Cc:	xiaosuo@...il.com, kuznet@....inr.ac.ru, pekkas@...core.fi,
	jmorris@...ei.org, yoshfuji@...ux-ipv6.org, kaber@...sh.net,
	therbert@...gle.com, netdev@...r.kernel.org
Subject: Re: [PATCH] inet, inet6: make tcp_sendmsg() and tcp_sendpage()
 through inet_sendmsg() and inet_sendpage()

From: Dimitris Michailidis <dm@...lsio.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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ