Skip to content

Commit 0db6f8b

Browse files
NicolasDichteldavem330
authored andcommitted
net/sched: fix ->get helper of the matchall cls
It returned always NULL, thus it was never possible to get the filter. Example: $ ip link add foo type dummy $ ip link add bar type dummy $ tc qdisc add dev foo clsact $ tc filter add dev foo protocol all pref 1 ingress handle 1234 \ matchall action mirred ingress mirror dev bar Before the patch: $ tc filter get dev foo protocol all pref 1 ingress handle 1234 matchall Error: Specified filter handle not found. We have an error talking to the kernel After: $ tc filter get dev foo protocol all pref 1 ingress handle 1234 matchall filter ingress protocol all pref 1 matchall chain 0 handle 0x4d2 not_in_hw action order 1: mirred (Ingress Mirror to device bar) pipe index 1 ref 1 bind 1 CC: Yotam Gigi <yotamg@mellanox.com> CC: Jiri Pirko <jiri@mellanox.com> Fixes: fd62d9f ("net/sched: matchall: Fix configuration race") Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 8c83f2d commit 0db6f8b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

net/sched/cls_matchall.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ static void mall_destroy(struct tcf_proto *tp, bool rtnl_held,
130130

131131
static void *mall_get(struct tcf_proto *tp, u32 handle)
132132
{
133+
struct cls_mall_head *head = rtnl_dereference(tp->root);
134+
135+
if (head && head->handle == handle)
136+
return head;
137+
133138
return NULL;
134139
}
135140

0 commit comments

Comments
 (0)