Skip to content

Commit

Permalink
net_sched: Default action lookup method for actions
Browse files Browse the repository at this point in the history
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jamal Hadi Salim authored and David S. Miller committed Dec 6, 2013
1 parent 76c82d7 commit 63ef617
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/sched/act_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 63ef617

Please sign in to comment.