Commit 382ca8a1 authored by Jamal Hadi Salim's avatar Jamal Hadi Salim Committed by David S. Miller

net_sched: Provide default walker function for actions

Signed-off-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 43c00dcf
...@@ -274,8 +274,11 @@ int tcf_register_action(struct tc_action_ops *act) ...@@ -274,8 +274,11 @@ int tcf_register_action(struct tc_action_ops *act)
if (!act->act || !act->dump || !act->cleanup || !act->init) if (!act->act || !act->dump || !act->cleanup || !act->init)
return -EINVAL; return -EINVAL;
/* Supply defaults */
if (!act->lookup) if (!act->lookup)
act->lookup = tcf_hash_search; act->lookup = tcf_hash_search;
if (!act->walk)
act->walk = tcf_generic_walker;
write_lock(&act_mod_lock); write_lock(&act_mod_lock);
for (ap = &act_base; (a = *ap) != NULL; ap = &a->next) { 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,12 +1092,6 @@ tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb)
memset(&a, 0, sizeof(struct tc_action)); memset(&a, 0, sizeof(struct tc_action));
a.ops = a_o; 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, nlh = nlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq,
cb->nlh->nlmsg_type, sizeof(*t), 0); cb->nlh->nlmsg_type, sizeof(*t), 0);
if (!nlh) if (!nlh)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment