[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1386167216-30281-5-git-send-email-jhs@mojatatu.com>
Date: Wed, 4 Dec 2013 09:26:55 -0500
From: Jamal Hadi Salim <jhs@...atatu.com>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org, eric.dumazet@...il.com,
alexander.h.duyck@...el.com, jhs@...atatu.com,
ebiederm@...ssion.com
Subject: [PATCH 4/5] net_sched: Provide default walker function for actions
Signed-off-by: Jamal Hadi Salim <jhs@...atatu.com>
---
net/sched/act_api.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index d1a022e..69cb848 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -274,8 +274,11 @@ int tcf_register_action(struct tc_action_ops *act)
if (!act->act || !act->dump || !act->cleanup || !act->init)
return -EINVAL;
+ /* Supply defaults */
if (!act->lookup)
act->lookup = tcf_hash_search;
+ if (!act->walk)
+ act->walk = tcf_generic_walker;
write_lock(&act_mod_lock);
for (ap = &act_base; (a = *ap) != NULL; ap = &a->next) {
@@ -1089,12 +1092,6 @@ tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb)
memset(&a, 0, sizeof(struct tc_action));
a.ops = a_o;
- if (a_o->walk == NULL) {
- WARN(1, "tc_dump_action: %s !capable of dumping table\n",
- a_o->kind);
- goto out_module_put;
- }
-
nlh = nlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq,
cb->nlh->nlmsg_type, sizeof(*t), 0);
if (!nlh)
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists