summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJamal Hadi Salim <jhs@mojatatu.com>2013-12-04 09:26:53 -0500
committerDavid S. Miller <davem@davemloft.net>2013-12-05 19:28:42 -0500
commit63ef6174654a986f263d25e957ef9d1ff243f649 (patch)
tree9164e1f1895c88bda3607809bc1ff909b7e123af /net
parent76c82d7a3d24a4ae1f9b098287c18055546c1a47 (diff)
downloadblackbird-op-linux-63ef6174654a986f263d25e957ef9d1ff243f649.tar.gz
blackbird-op-linux-63ef6174654a986f263d25e957ef9d1ff243f649.zip
net_sched: Default action lookup method 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.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 618695e84190..d1a022e441be 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -274,6 +274,9 @@ int tcf_register_action(struct tc_action_ops *act)
if (!act->act || !act->dump || !act->cleanup || !act->init)
return -EINVAL;
+ if (!act->lookup)
+ act->lookup = tcf_hash_search;
+
write_lock(&act_mod_lock);
for (ap = &act_base; (a = *ap) != NULL; ap = &a->next) {
if (act->type == a->type || (strcmp(act->kind, a->kind) == 0)) {
@@ -727,8 +730,6 @@ tcf_action_get_1(struct nlattr *nla, struct nlmsghdr *n, u32 portid)
a->ops = tc_lookup_action(tb[TCA_ACT_KIND]);
if (a->ops == NULL)
goto err_free;
- if (a->ops->lookup == NULL)
- goto err_mod;
err = -ENOENT;
if (a->ops->lookup(a, index) == 0)
goto err_mod;
OpenPOWER on IntegriCloud