]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Fix tcindex classifier ABI borkage...
authorPatrick McHardy <kaber@trash.net>
Tue, 10 Apr 2007 20:38:39 +0000 (13:38 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 13 Apr 2007 20:47:05 +0000 (13:47 -0700)
[NET_SCHED]: cls_tcindex: fix compatibility breakage

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: Greg Kroah-Hartman <gregkh@suse.de>
net/sched/cls_tcindex.c

index 5af8a59e1503c7d5a90cf332af72ee5921d94950..49bb50438491bbb7a03bba8f68329c953cd2ffe6 100644 (file)
@@ -245,9 +245,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;