From: Eric Dumazet <dada1@cosmosbay.com>
To: Jarek Poplawski <jarkao2@gmail.com>
Cc: David Miller <davem@davemloft.net>,
nhorman@tuxdriver.com, lav@yar.ru,
shemminger@linux-foundation.org, netdev@vger.kernel.org
Subject: Re: [PATCH] net: fix rtable leak in net/ipv4/route.c
Date: Wed, 20 May 2009 13:13:41 +0200 [thread overview]
Message-ID: <4A13E5E5.4060007@cosmosbay.com> (raw)
In-Reply-To: <20090520100318.GA5789@ff.dom.local>
Jarek Poplawski a écrit :
> On Wed, May 20, 2009 at 08:14:28AM +0200, Eric Dumazet wrote:
>> + for (aux = rt_hash_table[i].chain;;) {
>> + if (aux == rth) {
>> + length += ONE;
>> + break;
>> + }
>> + if (compare_hash_inputs(&aux->fl, &rth->fl))
>> + break;
>> + aux = aux->u.dst.rt_next;
>> + }
>
> Very "interesting" for() usage, but isn't it more readable like this?:
>
> aux = rt_hash_table[i].chain;
> while (aux != rth) {
> if (compare_hash_inputs(&aux->fl, &rth->fl))
> break;
> aux = aux->u.dst.rt_next;
> }
well, this test is done two times, this is the difference...
>
> if (aux == rth)
> length += ONE;
>
> Jarek P.
I first wrote :
for (aux = rt_hash_table[i].chain ; ; aux = aux->u.dst.rt_next) {
if (aux == rth) {
length += ONE;
break;
}
if (compare_hash_inputs(&aux->fl, &rth->fl))
break;
}
but had to split the too long line, so ended in the form in the patch :)
Thank you
next prev parent reply other threads:[~2009-05-20 11:13 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-19 2:35 Fw: [Bug 13339] New: rtable leak in ipv4/route.c Stephen Hemminger
2009-05-19 12:34 ` Jarek Poplawski
2009-05-19 15:12 ` Neil Horman
2009-05-19 15:32 ` Eric Dumazet
2009-05-19 16:20 ` Neil Horman
2009-05-19 18:47 ` Eric Dumazet
2009-05-19 19:24 ` Neil Horman
2009-05-19 22:05 ` David Miller
2009-05-19 23:05 ` Neil Horman
2009-05-20 4:54 ` [PATCH] net: fix length computation in rt_check_expire() Eric Dumazet
2009-05-20 6:13 ` David Miller
2009-05-20 6:14 ` [PATCH] net: fix rtable leak in net/ipv4/route.c Eric Dumazet
2009-05-20 10:03 ` Jarek Poplawski
2009-05-20 11:13 ` Eric Dumazet [this message]
2009-05-20 11:37 ` Jarek Poplawski
2009-05-20 10:48 ` Neil Horman
2009-05-21 0:19 ` David Miller
2009-05-20 10:27 ` [PATCH] net: fix length computation in rt_check_expire() Neil Horman
2009-05-21 0:19 ` David Miller
2009-05-19 16:23 ` Fw: [Bug 13339] New: rtable leak in ipv4/route.c Neil Horman
2009-05-19 17:17 ` Jarek Poplawski
2009-05-19 17:45 ` Neil Horman
2009-05-19 17:53 ` Jarek Poplawski
2009-05-19 18:05 ` Jarek Poplawski
2009-05-19 18:16 ` Neil Horman
2009-05-20 6:36 ` Alexander V. Lukyanov
2009-05-19 17:47 ` Jarek Poplawski
2009-05-19 17:22 ` Jarek Poplawski
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=4A13E5E5.4060007@cosmosbay.com \
--to=dada1@cosmosbay.com \
--cc=davem@davemloft.net \
--cc=jarkao2@gmail.com \
--cc=lav@yar.ru \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
--cc=shemminger@linux-foundation.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).