From: Paul Blakey Date: Sun, 3 Jun 2018 07:06:14 +0000 (+0300) Subject: cls_flower: Fix comparing of old filter mask with new filter X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=f6521c587a586de5fdafb0a322072e5ff67f8e15;p=openwrt%2Fstaging%2Fblogic.git cls_flower: Fix comparing of old filter mask with new filter We incorrectly compare the mask and the result is that we can't modify an already existing rule. Fix that by comparing correctly. Fixes: 05cd271fd61a ("cls_flower: Support multiple masks per priority") Reported-by: Vlad Buslov Reviewed-by: Roi Dayan Reviewed-by: Jiri Pirko Signed-off-by: Paul Blakey Reviewed-by: Simon Horman Signed-off-by: David S. Miller --- diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c index 159efd98ee9a..2b5be42a9f1c 100644 --- a/net/sched/cls_flower.c +++ b/net/sched/cls_flower.c @@ -877,7 +877,7 @@ static int fl_check_assign_mask(struct cls_fl_head *head, return PTR_ERR(newmask); fnew->mask = newmask; - } else if (fold && fold->mask == fnew->mask) { + } else if (fold && fold->mask != fnew->mask) { return -EINVAL; }