From: David Miller Date: Wed, 27 Sep 2006 23:25:17 +0000 (-0700) Subject: PKT_SCHED: cls_basic: Use unsigned int when generating handle X-Git-Tag: v2.6.18.1~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2fb7f11c1dc0cf66f290671f4a7b427e63da64c;p=thirdparty%2Fkernel%2Fstable.git PKT_SCHED: cls_basic: Use unsigned int when generating handle 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 Signed-off-by: Thomas Graf Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c index 86cac49a05314..09fda68c8b39f 100644 --- a/net/sched/cls_basic.c +++ b/net/sched/cls_basic.c @@ -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;