diff options
author | Jamal Hadi Salim <jhs@mojatatu.com> | 2013-12-04 09:26:55 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-05 19:28:42 -0500 |
commit | 382ca8a1ad8963c7676585f9e25f4c5ff8b28439 (patch) | |
tree | b91db92ae9edfc58e5dec5882487d93553f86da4 /net | |
parent | 43c00dcf8888daea234226e8adf09c37b00d2245 (diff) |
net_sched: Provide default walker function for actions
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/sched/act_api.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/net/sched/act_api.c b/net/sched/act_api.c index d1a022e441be..69cb848e8345 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) | |||
274 | if (!act->act || !act->dump || !act->cleanup || !act->init) | 274 | if (!act->act || !act->dump || !act->cleanup || !act->init) |
275 | return -EINVAL; | 275 | return -EINVAL; |
276 | 276 | ||
277 | /* Supply defaults */ | ||
277 | if (!act->lookup) | 278 | if (!act->lookup) |
278 | act->lookup = tcf_hash_search; | 279 | act->lookup = tcf_hash_search; |
280 | if (!act->walk) | ||
281 | act->walk = tcf_generic_walker; | ||
279 | 282 | ||
280 | write_lock(&act_mod_lock); | 283 | write_lock(&act_mod_lock); |
281 | for (ap = &act_base; (a = *ap) != NULL; ap = &a->next) { | 284 | 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) | |||
1089 | memset(&a, 0, sizeof(struct tc_action)); | 1092 | memset(&a, 0, sizeof(struct tc_action)); |
1090 | a.ops = a_o; | 1093 | a.ops = a_o; |
1091 | 1094 | ||
1092 | if (a_o->walk == NULL) { | ||
1093 | WARN(1, "tc_dump_action: %s !capable of dumping table\n", | ||
1094 | a_o->kind); | ||
1095 | goto out_module_put; | ||
1096 | } | ||
1097 | |||
1098 | nlh = nlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq, | 1095 | nlh = nlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq, |
1099 | cb->nlh->nlmsg_type, sizeof(*t), 0); | 1096 | cb->nlh->nlmsg_type, sizeof(*t), 0); |
1100 | if (!nlh) | 1097 | if (!nlh) |