]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
net: sched: route: don't set arg->stop in route4_walk() when empty
authorVlad Buslov <vladbu@mellanox.com>
Fri, 15 Feb 2019 15:21:00 +0000 (17:21 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 17 Feb 2019 21:24:39 +0000 (13:24 -0800)
Some classifiers set arg->stop in their implementation of tp->walk() API
when empty. Most of classifiers do not adhere to that convention. Do not
set arg->stop in route4_walk() to unify tp->walk() behavior among
classifier implementations.

Fixes: ed76f5edccc9 ("net: sched: protect filter_chain list with filter_chain_lock mutex")
Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_route.c

index e590c3a2999d5372af2b78387ea1b2a14c359569..444d15a75d98ba072a2375fc87a881c06f6ac27c 100644 (file)
@@ -567,10 +567,7 @@ static void route4_walk(struct tcf_proto *tp, struct tcf_walker *arg,
        struct route4_head *head = rtnl_dereference(tp->root);
        unsigned int h, h1;
 
-       if (head == NULL)
-               arg->stop = 1;
-
-       if (arg->stop)
+       if (head == NULL || arg->stop)
                return;
 
        for (h = 0; h <= 256; h++) {