1 Jul 2004 01:01
Re: Check connect address in NETLINK
Herbert Xu <herbert <at> gondor.apana.org.au>
2004-06-30 23:01:47 GMT
2004-06-30 23:01:47 GMT
On Wed, Jun 30, 2004 at 03:36:06PM -0700, David S. Miller wrote:
>
> Why don't you combine the two "ERR_PTR(-ECONNREFUSED)" tests
> into one test like:
>
> if ((nlk->pid == 0 && !nlk->data_ready) ||
> (sock->sk_state == NELTINK_CONNECTED &&
> nlk->dst_pid != nlk_sk(ssk)->pid)) {
> sock_put(sock);
> return ERR_PTR(-ECONNREFUSED);
> }
>
> so we don't have two copies of the "sock_put(); return ERR_PTR()"
> thing emitted by the compiler?
Well at least under i386, gcc (3.3.4) is smart enough to merge these
common exit paths.
But yes we could merge them. What about the following incremental
patch?
--
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert <at> gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--- work-2.6/net/netlink/af_netlink.c.orig 2004-07-01 08:56:55.000000000 +1000 +++ work-2.6/net/netlink/af_netlink.c 2004-07-01 08:59:14.000000000 +1000 <at> <at> -425,21 +425,23 <at> <at>(Continue reading)
RSS Feed