From: Patrick McHardy <kaber@trash.net>
To: Thomas Graf <tgraf@suug.ch>
Cc: davem@davemloft.net, kim.nordlund@nokia.com, netdev@vger.kernel.org
Subject: Re: [PKT_SCHED] cls_basic: Use unsigned int when generating handle
Date: Tue, 26 Sep 2006 15:32:04 +0200 [thread overview]
Message-ID: <45192BD4.9030702@trash.net> (raw)
In-Reply-To: <20060926115910.GV18349@postel.suug.ch>
Thomas Graf wrote:
> Prevents filters from being added if the first generated
> handle already exists.
>
> Signed-off-by: Kim Nordlund <kim.nordlund@nokia.com>
> Signed-off-by: Thomas Graf <tgraf@suug.ch>
>
> Index: net-2.6/net/sched/cls_basic.c
> ===================================================================
> --- net-2.6.orig/net/sched/cls_basic.c 2006-09-26 13:35:29.000000000 +0200
> +++ net-2.6/net/sched/cls_basic.c 2006-09-26 13:35:39.000000000 +0200
> @@ -194,7 +194,7 @@
> if (handle)
> f->handle = handle;
> else {
> - int i = 0x80000000;
> + unsigned int i = 0x80000000;
I don't see how this patch changes anything, the loop already
ends when i == 0 (and it can't go negative):
do {
if (++head->hgenerator == 0x7FFFFFFF)
head->hgenerator = 1;
} while (--i > 0 && basic_get(tp, head->hgenerator));
which should also make sure that no handle gets used twice:
if (i <= 0) {
printk(KERN_ERR "Insufficient number of handles\n");
goto errout;
}
next prev parent reply other threads:[~2006-09-26 13:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-26 11:59 [PKT_SCHED] cls_basic: Use unsigned int when generating handle Thomas Graf
2006-09-26 13:32 ` Patrick McHardy [this message]
2006-09-26 18:36 ` Thomas Graf
2006-09-27 8:50 ` Nordlund Kim (Nokia-NET/Helsinki)
2006-09-27 9:33 ` Thomas Graf
2006-09-27 9:44 ` Patrick McHardy
2006-09-27 10:09 ` Thomas Graf
2006-09-27 11:45 ` Nordlund Kim (Nokia-NET/Helsinki)
2006-09-27 23:18 ` David Miller
2006-09-27 23:21 ` 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=45192BD4.9030702@trash.net \
--to=kaber@trash.net \
--cc=davem@davemloft.net \
--cc=kim.nordlund@nokia.com \
--cc=netdev@vger.kernel.org \
--cc=tgraf@suug.ch \
/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).