summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorIvan Vecera <ivecera@redhat.com>2018-02-08 16:10:39 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-08 22:41:14 -0800
commit54d6bc97b4c9af3dee9fc594c88d1ea1f9382630 (patch)
treeb02fa538869b45140acc3406a31e46a219bd4638 /net
parenta01550d778a4dd00bfcc548f2bfd57184192cd32 (diff)
downloadlinux-stable-54d6bc97b4c9af3dee9fc594c88d1ea1f9382630.tar.gz
linux-stable-54d6bc97b4c9af3dee9fc594c88d1ea1f9382630.tar.bz2
linux-stable-54d6bc97b4c9af3dee9fc594c88d1ea1f9382630.zip
net/sched: cls_u32: fix cls_u32 on filter replace
[ Upstream commit eb53f7af6f15285e2f6ada97285395343ce9f433 ] The following sequence is currently broken: # tc qdisc add dev foo ingress # tc filter replace dev foo protocol all ingress \ u32 match u8 0 0 action mirred egress mirror dev bar1 # tc filter replace dev foo protocol all ingress \ handle 800::800 pref 49152 \ u32 match u8 0 0 action mirred egress mirror dev bar2 Error: cls_u32: Key node flags do not match passed flags. We have an error talking to the kernel, -1 The error comes from u32_change() when comparing new and existing flags. The existing ones always contains one of TCA_CLS_FLAGS_{,NOT}_IN_HW flag depending on offloading state. These flags cannot be passed from userspace so the condition (n->flags != flags) in u32_change() always fails. Fix the condition so the flags TCA_CLS_FLAGS_NOT_IN_HW and TCA_CLS_FLAGS_IN_HW are not taken into account. Fixes: 24d3dc6d27ea ("net/sched: cls_u32: Reflect HW offload status") Signed-off-by: Ivan Vecera <ivecera@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r--net/sched/cls_u32.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index b58eccb21f03..1ce7c1763e81 100644
--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -927,7 +927,8 @@ static int u32_change(struct net *net, struct sk_buff *in_skb,
if (TC_U32_KEY(n->handle) == 0)
return -EINVAL;
- if (n->flags != flags)
+ if ((n->flags ^ flags) &
+ ~(TCA_CLS_FLAGS_IN_HW | TCA_CLS_FLAGS_NOT_IN_HW))
return -EINVAL;
new = u32_init_knode(tp, n);