]> git.hungrycats.org Git - linux/commitdiff
PKT_SCHED: cls_basic: Use unsigned int when generating handle
authorDavid Miller <davem@davemloft.net>
Wed, 27 Sep 2006 23:25:17 +0000 (16:25 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 13 Oct 2006 20:23:27 +0000 (13:23 -0700)
gcc-4.1 and later take advantage of the fact that in the
C language certain types of overflow/underflow are undefined,
and this is completely legitimate.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/sched/cls_basic.c

index 86cac49a0531476d716c31c9a195571063bb9117..09fda68c8b39f494f6b5802a99efc34a39cdc030 100644 (file)
@@ -194,7 +194,7 @@ static int basic_change(struct tcf_proto *tp, unsigned long base, u32 handle,
        if (handle)
                f->handle = handle;
        else {
-               int i = 0x80000000;
+               unsigned int i = 0x80000000;
                do {
                        if (++head->hgenerator == 0x7FFFFFFF)
                                head->hgenerator = 1;