Commit f2fb7f11 authored by David Miller's avatar David Miller Committed by Greg Kroah-Hartman

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: default avatarKim Nordlund <kim.nordlund@nokia.com>
Signed-off-by: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 521a3b74
...@@ -194,7 +194,7 @@ static int basic_change(struct tcf_proto *tp, unsigned long base, u32 handle, ...@@ -194,7 +194,7 @@ static int basic_change(struct tcf_proto *tp, unsigned long base, u32 handle,
if (handle) if (handle)
f->handle = handle; f->handle = handle;
else { else {
int i = 0x80000000; unsigned int i = 0x80000000;
do { do {
if (++head->hgenerator == 0x7FFFFFFF) if (++head->hgenerator == 0x7FFFFFFF)
head->hgenerator = 1; head->hgenerator = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment