From: shemminger Date: Wed, 22 Mar 2006 00:07:49 +0000 (+0000) Subject: Backout the 2.4 utsname hash patch. X-Git-Tag: ss-060323~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=267480f55383cb9f7ddf82412814d3147510df01;p=thirdparty%2Fiproute2.git Backout the 2.4 utsname hash patch. --- diff --git a/ChangeLog b/ChangeLog index 27d4c1b0a..3590a647f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-03-21 Stephen Hemminger + + * Back out the 2.4 utsname patch + 2006-03-21 James Lentini * Increase size of hw address allowed for ip neigh to allow diff --git a/tc/f_u32.c b/tc/f_u32.c index 243088e80..9d527fc07 100644 --- a/tc/f_u32.c +++ b/tc/f_u32.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include @@ -877,7 +876,7 @@ static int u32_parse_opt(struct filter_util *qu, char *handle, int argc, char ** } else if (strcmp(*argv, "sample") == 0) { __u32 hash; unsigned divisor = 0x100; - struct utsname utsname; + struct { struct tc_u32_sel sel; struct tc_u32_key keys[4]; @@ -902,19 +901,8 @@ static int u32_parse_opt(struct filter_util *qu, char *handle, int argc, char ** NEXT_ARG(); } hash = sel2.sel.keys[0].val&sel2.sel.keys[0].mask; - uname(&utsname); - if (strncmp(utsname.release, "2.4.", 4) == 0) { - hash ^= hash>>16; - hash ^= hash>>8; - } - else { - __u32 mask = sel2.sel.keys[0].mask; - while (mask && !(mask & 1)) { - mask >>= 1; - hash >>= 1; - } - hash &= 0xFF; - } + hash ^= hash>>16; + hash ^= hash>>8; htid = ((hash%divisor)<<12)|(htid&0xFFF00000); sample_ok = 1; continue;