X-Git-Url: https://git.proxmox.com/?p=iproute2.git;a=blobdiff_plain;f=debian%2Fpatches%2Ff_u32;fp=debian%2Fpatches%2Ff_u32;h=0000000000000000000000000000000000000000;hp=4505533652ad4d61ac57a01286c5a0b0ea375dd5;hb=cd0d3ac3065ea4bdbdb3c1907ef754f3e2bffa45;hpb=ced20272d28f9d03fedb957f11d2ef3117c31a46 diff --git a/debian/patches/f_u32 b/debian/patches/f_u32 deleted file mode 100644 index 4505533..0000000 --- a/debian/patches/f_u32 +++ /dev/null @@ -1,63 +0,0 @@ -#! /bin/sh -e -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: Fixes the u32 calculation for 2.6 kernel - by Russell Stuart - -[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts -patch_opts="${patch_opts:--f --no-backup-if-mismatch}" - -if [ $# -ne 1 ]; then - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1 -fi -case "$1" in - -patch) patch $patch_opts -p1 < $0;; - -unpatch) patch $patch_opts -p1 -R < $0;; - *) - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1;; -esac - -exit 0 -@DPATCH@ -diff -Nur iproute-20051007.keep/tc/f_u32.c iproute-20051007/tc/f_u32.c ---- iproute-20051007.keep/tc/f_u32.c 2006-01-12 17:34:37.000000000 +1000 -+++ iproute-20051007/tc/f_u32.c 2006-02-07 17:10:29.000000000 +1000 -@@ -17,6 +17,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -874,6 +875,7 @@ - htid = (handle&0xFFFFF000); - } else if (strcmp(*argv, "sample") == 0) { - __u32 hash; -+ struct utsname utsname; - struct { - struct tc_u32_sel sel; - struct tc_u32_key keys[4]; -@@ -889,8 +891,19 @@ - return -1; - } - hash = sel2.sel.keys[0].val&sel2.sel.keys[0].mask; -- hash ^= hash>>16; -- hash ^= hash>>8; -+ 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; -+ } - htid = ((hash<<12)&0xFF000)|(htid&0xFFF00000); - sample_ok = 1; - continue;