]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[NET_SCHED]: cls_tcindex: fix compatibility breakage
authorPatrick McHardy <kaber@trash.net>
Fri, 13 Apr 2007 19:34:16 +0000 (21:34 +0200)
committerAdrian Bunk <bunk@stusta.de>
Fri, 13 Apr 2007 20:58:27 +0000 (22:58 +0200)
Userspace uses an integer for TCA_TCINDEX_SHIFT, the kernel was changed
to expect and use a u16 value in 2.6.11, which broke compatibility on
big endian machines. Change back to use int.

Reported by Ole Reinartz <ole.reinartz@gmx.de>

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
net/sched/cls_tcindex.c

index 9f921174c8ab39d33e9544c9b78051b3b8a12cdf..d8f8ad269a4c58788775e426d5b15a5fbd565778 100644 (file)
@@ -247,9 +247,9 @@ tcindex_set_parms(struct tcf_proto *tp, unsigned long base, u32 handle,
        }
 
        if (tb[TCA_TCINDEX_SHIFT-1]) {
-               if (RTA_PAYLOAD(tb[TCA_TCINDEX_SHIFT-1]) < sizeof(u16))
+               if (RTA_PAYLOAD(tb[TCA_TCINDEX_SHIFT-1]) < sizeof(int))
                        goto errout;
-               cp.shift = *(u16 *) RTA_DATA(tb[TCA_TCINDEX_SHIFT-1]);
+               cp.shift = *(int *) RTA_DATA(tb[TCA_TCINDEX_SHIFT-1]);
        }
 
        err = -EBUSY;