diff options
Diffstat (limited to 'net/sched/act_api.c')
-rw-r--r-- | net/sched/act_api.c | 5 |
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) | |||
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 | if (!act->lookup) | ||
278 | act->lookup = tcf_hash_search; | ||
279 | |||
277 | write_lock(&act_mod_lock); | 280 | write_lock(&act_mod_lock); |
278 | for (ap = &act_base; (a = *ap) != NULL; ap = &a->next) { | 281 | for (ap = &act_base; (a = *ap) != NULL; ap = &a->next) { |
279 | if (act->type == a->type || (strcmp(act->kind, a->kind) == 0)) { | 282 | 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) | |||
727 | a->ops = tc_lookup_action(tb[TCA_ACT_KIND]); | 730 | a->ops = tc_lookup_action(tb[TCA_ACT_KIND]); |
728 | if (a->ops == NULL) | 731 | if (a->ops == NULL) |
729 | goto err_free; | 732 | goto err_free; |
730 | if (a->ops->lookup == NULL) | ||
731 | goto err_mod; | ||
732 | err = -ENOENT; | 733 | err = -ENOENT; |
733 | if (a->ops->lookup(a, index) == 0) | 734 | if (a->ops->lookup(a, index) == 0) |
734 | goto err_mod; | 735 | goto err_mod; |