2 * net/sched/act_api.c Packet action API.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
9 * Author: Jamal Hadi Salim
14 #include <linux/types.h>
15 #include <linux/kernel.h>
16 #include <linux/string.h>
17 #include <linux/errno.h>
18 #include <linux/slab.h>
19 #include <linux/skbuff.h>
20 #include <linux/init.h>
21 #include <linux/kmod.h>
22 #include <linux/err.h>
23 #include <linux/module.h>
24 #include <net/net_namespace.h>
26 #include <net/sch_generic.h>
27 #include <net/act_api.h>
28 #include <net/netlink.h>
30 static void free_tcf(struct rcu_head *head)
32 struct tc_action *p = container_of(head, struct tc_action, tcfa_rcu);
34 free_percpu(p->cpu_bstats);
35 free_percpu(p->cpu_qstats);
39 static void tcf_hash_destroy(struct tcf_hashinfo *hinfo, struct tc_action *p)
41 spin_lock_bh(&hinfo->lock);
42 hlist_del(&p->tcfa_head);
43 spin_unlock_bh(&hinfo->lock);
44 gen_kill_estimator(&p->tcfa_rate_est);
46 * gen_estimator est_timer() might access p->tcfa_lock
47 * or bstats, wait a RCU grace period before freeing p
49 call_rcu(&p->tcfa_rcu, free_tcf);
52 int __tcf_hash_release(struct tc_action *p, bool bind, bool strict)
59 else if (strict && p->tcfa_bindcnt > 0)
63 if (p->tcfa_bindcnt <= 0 && p->tcfa_refcnt <= 0) {
65 p->ops->cleanup(p, bind);
66 tcf_hash_destroy(p->hinfo, p);
73 EXPORT_SYMBOL(__tcf_hash_release);
75 static int tcf_dump_walker(struct tcf_hashinfo *hinfo, struct sk_buff *skb,
76 struct netlink_callback *cb)
78 int err = 0, index = -1, i = 0, s_i = 0, n_i = 0;
81 spin_lock_bh(&hinfo->lock);
85 for (i = 0; i < (hinfo->hmask + 1); i++) {
86 struct hlist_head *head;
89 head = &hinfo->htab[tcf_hash(i, hinfo->hmask)];
91 hlist_for_each_entry_rcu(p, head, tcfa_head) {
96 nest = nla_nest_start(skb, n_i);
99 err = tcf_action_dump_1(skb, p, 0, 0);
102 nlmsg_trim(skb, nest);
105 nla_nest_end(skb, nest);
107 if (n_i >= TCA_ACT_MAX_PRIO)
112 spin_unlock_bh(&hinfo->lock);
118 nla_nest_cancel(skb, nest);
122 static int tcf_del_walker(struct tcf_hashinfo *hinfo, struct sk_buff *skb,
123 const struct tc_action_ops *ops)
129 nest = nla_nest_start(skb, 0);
131 goto nla_put_failure;
132 if (nla_put_string(skb, TCA_KIND, ops->kind))
133 goto nla_put_failure;
134 for (i = 0; i < (hinfo->hmask + 1); i++) {
135 struct hlist_head *head;
136 struct hlist_node *n;
139 head = &hinfo->htab[tcf_hash(i, hinfo->hmask)];
140 hlist_for_each_entry_safe(p, n, head, tcfa_head) {
141 ret = __tcf_hash_release(p, false, true);
142 if (ret == ACT_P_DELETED) {
143 module_put(p->ops->owner);
146 goto nla_put_failure;
149 if (nla_put_u32(skb, TCA_FCNT, n_i))
150 goto nla_put_failure;
151 nla_nest_end(skb, nest);
155 nla_nest_cancel(skb, nest);
159 int tcf_generic_walker(struct tc_action_net *tn, struct sk_buff *skb,
160 struct netlink_callback *cb, int type,
161 const struct tc_action_ops *ops)
163 struct tcf_hashinfo *hinfo = tn->hinfo;
165 if (type == RTM_DELACTION) {
166 return tcf_del_walker(hinfo, skb, ops);
167 } else if (type == RTM_GETACTION) {
168 return tcf_dump_walker(hinfo, skb, cb);
170 WARN(1, "tcf_generic_walker: unknown action %d\n", type);
174 EXPORT_SYMBOL(tcf_generic_walker);
176 static struct tc_action *tcf_hash_lookup(u32 index, struct tcf_hashinfo *hinfo)
178 struct tc_action *p = NULL;
179 struct hlist_head *head;
181 spin_lock_bh(&hinfo->lock);
182 head = &hinfo->htab[tcf_hash(index, hinfo->hmask)];
183 hlist_for_each_entry_rcu(p, head, tcfa_head)
184 if (p->tcfa_index == index)
186 spin_unlock_bh(&hinfo->lock);
191 u32 tcf_hash_new_index(struct tc_action_net *tn)
193 struct tcf_hashinfo *hinfo = tn->hinfo;
194 u32 val = hinfo->index;
199 } while (tcf_hash_lookup(val, hinfo));
204 EXPORT_SYMBOL(tcf_hash_new_index);
206 int tcf_hash_search(struct tc_action_net *tn, struct tc_action **a, u32 index)
208 struct tcf_hashinfo *hinfo = tn->hinfo;
209 struct tc_action *p = tcf_hash_lookup(index, hinfo);
217 EXPORT_SYMBOL(tcf_hash_search);
219 bool tcf_hash_check(struct tc_action_net *tn, u32 index, struct tc_action **a,
222 struct tcf_hashinfo *hinfo = tn->hinfo;
223 struct tc_action *p = NULL;
225 if (index && (p = tcf_hash_lookup(index, hinfo)) != NULL) {
234 EXPORT_SYMBOL(tcf_hash_check);
236 void tcf_hash_cleanup(struct tc_action *a, struct nlattr *est)
239 gen_kill_estimator(&a->tcfa_rate_est);
240 call_rcu(&a->tcfa_rcu, free_tcf);
242 EXPORT_SYMBOL(tcf_hash_cleanup);
244 int tcf_hash_create(struct tc_action_net *tn, u32 index, struct nlattr *est,
245 struct tc_action **a, const struct tc_action_ops *ops,
246 int bind, bool cpustats)
248 struct tc_action *p = kzalloc(ops->size, GFP_KERNEL);
249 struct tcf_hashinfo *hinfo = tn->hinfo;
259 p->cpu_bstats = netdev_alloc_pcpu_stats(struct gnet_stats_basic_cpu);
260 if (!p->cpu_bstats) {
265 p->cpu_qstats = alloc_percpu(struct gnet_stats_queue);
266 if (!p->cpu_qstats) {
268 free_percpu(p->cpu_bstats);
272 spin_lock_init(&p->tcfa_lock);
273 INIT_HLIST_NODE(&p->tcfa_head);
274 p->tcfa_index = index ? index : tcf_hash_new_index(tn);
275 p->tcfa_tm.install = jiffies;
276 p->tcfa_tm.lastuse = jiffies;
277 p->tcfa_tm.firstuse = 0;
279 err = gen_new_estimator(&p->tcfa_bstats, p->cpu_bstats,
281 &p->tcfa_lock, NULL, est);
283 free_percpu(p->cpu_qstats);
290 INIT_LIST_HEAD(&p->list);
294 EXPORT_SYMBOL(tcf_hash_create);
296 void tcf_hash_insert(struct tc_action_net *tn, struct tc_action *a)
298 struct tcf_hashinfo *hinfo = tn->hinfo;
299 unsigned int h = tcf_hash(a->tcfa_index, hinfo->hmask);
301 spin_lock_bh(&hinfo->lock);
302 hlist_add_head(&a->tcfa_head, &hinfo->htab[h]);
303 spin_unlock_bh(&hinfo->lock);
305 EXPORT_SYMBOL(tcf_hash_insert);
307 void tcf_hashinfo_destroy(const struct tc_action_ops *ops,
308 struct tcf_hashinfo *hinfo)
312 for (i = 0; i < hinfo->hmask + 1; i++) {
314 struct hlist_node *n;
316 hlist_for_each_entry_safe(p, n, &hinfo->htab[i], tcfa_head) {
319 ret = __tcf_hash_release(p, false, true);
320 if (ret == ACT_P_DELETED)
321 module_put(ops->owner);
328 EXPORT_SYMBOL(tcf_hashinfo_destroy);
330 static LIST_HEAD(act_base);
331 static DEFINE_RWLOCK(act_mod_lock);
333 int tcf_register_action(struct tc_action_ops *act,
334 struct pernet_operations *ops)
336 struct tc_action_ops *a;
339 if (!act->act || !act->dump || !act->init || !act->walk || !act->lookup)
342 /* We have to register pernet ops before making the action ops visible,
343 * otherwise tcf_action_init_1() could get a partially initialized
346 ret = register_pernet_subsys(ops);
350 write_lock(&act_mod_lock);
351 list_for_each_entry(a, &act_base, head) {
352 if (act->type == a->type || (strcmp(act->kind, a->kind) == 0)) {
353 write_unlock(&act_mod_lock);
354 unregister_pernet_subsys(ops);
358 list_add_tail(&act->head, &act_base);
359 write_unlock(&act_mod_lock);
363 EXPORT_SYMBOL(tcf_register_action);
365 int tcf_unregister_action(struct tc_action_ops *act,
366 struct pernet_operations *ops)
368 struct tc_action_ops *a;
371 write_lock(&act_mod_lock);
372 list_for_each_entry(a, &act_base, head) {
374 list_del(&act->head);
379 write_unlock(&act_mod_lock);
381 unregister_pernet_subsys(ops);
384 EXPORT_SYMBOL(tcf_unregister_action);
387 static struct tc_action_ops *tc_lookup_action_n(char *kind)
389 struct tc_action_ops *a, *res = NULL;
392 read_lock(&act_mod_lock);
393 list_for_each_entry(a, &act_base, head) {
394 if (strcmp(kind, a->kind) == 0) {
395 if (try_module_get(a->owner))
400 read_unlock(&act_mod_lock);
405 /* lookup by nlattr */
406 static struct tc_action_ops *tc_lookup_action(struct nlattr *kind)
408 struct tc_action_ops *a, *res = NULL;
411 read_lock(&act_mod_lock);
412 list_for_each_entry(a, &act_base, head) {
413 if (nla_strcmp(kind, a->kind) == 0) {
414 if (try_module_get(a->owner))
419 read_unlock(&act_mod_lock);
424 int tcf_action_exec(struct sk_buff *skb, struct tc_action **actions,
425 int nr_actions, struct tcf_result *res)
429 if (skb_skip_tc_classify(skb))
432 for (i = 0; i < nr_actions; i++) {
433 const struct tc_action *a = actions[i];
436 ret = a->ops->act(skb, a, res);
437 if (ret == TC_ACT_REPEAT)
438 goto repeat; /* we need a ttl - JHS */
439 if (ret != TC_ACT_PIPE)
444 EXPORT_SYMBOL(tcf_action_exec);
446 int tcf_action_destroy(struct list_head *actions, int bind)
448 struct tc_action *a, *tmp;
451 list_for_each_entry_safe(a, tmp, actions, list) {
452 ret = __tcf_hash_release(a, bind, true);
453 if (ret == ACT_P_DELETED)
454 module_put(a->ops->owner);
462 tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
464 return a->ops->dump(skb, a, bind, ref);
468 tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
471 unsigned char *b = skb_tail_pointer(skb);
474 if (nla_put_string(skb, TCA_KIND, a->ops->kind))
475 goto nla_put_failure;
476 if (tcf_action_copy_stats(skb, a, 0))
477 goto nla_put_failure;
478 nest = nla_nest_start(skb, TCA_OPTIONS);
480 goto nla_put_failure;
481 err = tcf_action_dump_old(skb, a, bind, ref);
483 nla_nest_end(skb, nest);
491 EXPORT_SYMBOL(tcf_action_dump_1);
493 int tcf_action_dump(struct sk_buff *skb, struct list_head *actions,
500 list_for_each_entry(a, actions, list) {
501 nest = nla_nest_start(skb, a->order);
503 goto nla_put_failure;
504 err = tcf_action_dump_1(skb, a, bind, ref);
507 nla_nest_end(skb, nest);
515 nla_nest_cancel(skb, nest);
519 struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla,
520 struct nlattr *est, char *name, int ovr,
524 struct tc_action_ops *a_o;
525 char act_name[IFNAMSIZ];
526 struct nlattr *tb[TCA_ACT_MAX + 1];
531 err = nla_parse_nested(tb, TCA_ACT_MAX, nla, NULL);
535 kind = tb[TCA_ACT_KIND];
538 if (nla_strlcpy(act_name, kind, IFNAMSIZ) >= IFNAMSIZ)
542 if (strlcpy(act_name, name, IFNAMSIZ) >= IFNAMSIZ)
546 a_o = tc_lookup_action_n(act_name);
548 #ifdef CONFIG_MODULES
550 request_module("act_%s", act_name);
553 a_o = tc_lookup_action_n(act_name);
555 /* We dropped the RTNL semaphore in order to
556 * perform the module load. So, even if we
557 * succeeded in loading the module we have to
558 * tell the caller to replay the request. We
559 * indicate this using -EAGAIN.
570 /* backward compatibility for policer */
572 err = a_o->init(net, tb[TCA_ACT_OPTIONS], est, &a, ovr, bind);
574 err = a_o->init(net, nla, est, &a, ovr, bind);
578 /* module count goes up only when brand new policy is created
579 * if it exists and is only bound to in a_o->init() then
580 * ACT_P_CREATED is not returned (a zero is).
582 if (err != ACT_P_CREATED)
583 module_put(a_o->owner);
588 module_put(a_o->owner);
593 static void cleanup_a(struct list_head *actions, int ovr)
600 list_for_each_entry(a, actions, list)
604 int tcf_action_init(struct net *net, struct nlattr *nla, struct nlattr *est,
605 char *name, int ovr, int bind, struct list_head *actions)
607 struct nlattr *tb[TCA_ACT_MAX_PRIO + 1];
608 struct tc_action *act;
612 err = nla_parse_nested(tb, TCA_ACT_MAX_PRIO, nla, NULL);
616 for (i = 1; i <= TCA_ACT_MAX_PRIO && tb[i]; i++) {
617 act = tcf_action_init_1(net, tb[i], est, name, ovr, bind);
625 list_add_tail(&act->list, actions);
628 /* Remove the temp refcnt which was necessary to protect against
629 * destroying an existing action which was being replaced
631 cleanup_a(actions, ovr);
635 tcf_action_destroy(actions, bind);
639 int tcf_action_copy_stats(struct sk_buff *skb, struct tc_action *p,
648 /* compat_mode being true specifies a call that is supposed
649 * to add additional backward compatibility statistic TLVs.
652 if (p->type == TCA_OLD_COMPAT)
653 err = gnet_stats_start_copy_compat(skb, 0,
661 err = gnet_stats_start_copy(skb, TCA_ACT_STATS,
662 &p->tcfa_lock, &d, TCA_ACT_PAD);
667 if (gnet_stats_copy_basic(NULL, &d, p->cpu_bstats, &p->tcfa_bstats) < 0 ||
668 gnet_stats_copy_rate_est(&d, &p->tcfa_rate_est) < 0 ||
669 gnet_stats_copy_queue(&d, p->cpu_qstats,
671 p->tcfa_qstats.qlen) < 0)
674 if (gnet_stats_finish_copy(&d) < 0)
683 static int tca_get_fill(struct sk_buff *skb, struct list_head *actions,
684 u32 portid, u32 seq, u16 flags, int event, int bind,
688 struct nlmsghdr *nlh;
689 unsigned char *b = skb_tail_pointer(skb);
692 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*t), flags);
696 t->tca_family = AF_UNSPEC;
700 nest = nla_nest_start(skb, TCA_ACT_TAB);
704 if (tcf_action_dump(skb, actions, bind, ref) < 0)
707 nla_nest_end(skb, nest);
709 nlh->nlmsg_len = skb_tail_pointer(skb) - b;
718 act_get_notify(struct net *net, u32 portid, struct nlmsghdr *n,
719 struct list_head *actions, int event)
723 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
726 if (tca_get_fill(skb, actions, portid, n->nlmsg_seq, 0, event,
732 return rtnl_unicast(skb, net, portid);
735 static struct tc_action *tcf_action_get_1(struct net *net, struct nlattr *nla,
736 struct nlmsghdr *n, u32 portid)
738 struct nlattr *tb[TCA_ACT_MAX + 1];
739 const struct tc_action_ops *ops;
744 err = nla_parse_nested(tb, TCA_ACT_MAX, nla, NULL);
749 if (tb[TCA_ACT_INDEX] == NULL ||
750 nla_len(tb[TCA_ACT_INDEX]) < sizeof(index))
752 index = nla_get_u32(tb[TCA_ACT_INDEX]);
755 ops = tc_lookup_action(tb[TCA_ACT_KIND]);
756 if (!ops) /* could happen in batch of actions */
759 if (ops->lookup(net, &a, index) == 0)
762 module_put(ops->owner);
766 module_put(ops->owner);
771 static int tca_action_flush(struct net *net, struct nlattr *nla,
772 struct nlmsghdr *n, u32 portid)
776 struct nlmsghdr *nlh;
778 struct netlink_callback dcb;
780 struct nlattr *tb[TCA_ACT_MAX + 1];
781 const struct tc_action_ops *ops;
785 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
787 pr_debug("tca_action_flush: failed skb alloc\n");
791 b = skb_tail_pointer(skb);
793 err = nla_parse_nested(tb, TCA_ACT_MAX, nla, NULL);
798 kind = tb[TCA_ACT_KIND];
799 ops = tc_lookup_action(kind);
800 if (!ops) /*some idjot trying to flush unknown action */
803 nlh = nlmsg_put(skb, portid, n->nlmsg_seq, RTM_DELACTION,
808 t->tca_family = AF_UNSPEC;
812 nest = nla_nest_start(skb, TCA_ACT_TAB);
816 err = ops->walk(net, skb, &dcb, RTM_DELACTION, ops);
822 nla_nest_end(skb, nest);
824 nlh->nlmsg_len = skb_tail_pointer(skb) - b;
825 nlh->nlmsg_flags |= NLM_F_ROOT;
826 module_put(ops->owner);
827 err = rtnetlink_send(skb, net, portid, RTNLGRP_TC,
828 n->nlmsg_flags & NLM_F_ECHO);
835 module_put(ops->owner);
843 tcf_del_notify(struct net *net, struct nlmsghdr *n, struct list_head *actions,
849 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
853 if (tca_get_fill(skb, actions, portid, n->nlmsg_seq, 0, RTM_DELACTION,
859 /* now do the delete */
860 ret = tcf_action_destroy(actions, 0);
866 ret = rtnetlink_send(skb, net, portid, RTNLGRP_TC,
867 n->nlmsg_flags & NLM_F_ECHO);
874 tca_action_gd(struct net *net, struct nlattr *nla, struct nlmsghdr *n,
875 u32 portid, int event)
878 struct nlattr *tb[TCA_ACT_MAX_PRIO + 1];
879 struct tc_action *act;
882 ret = nla_parse_nested(tb, TCA_ACT_MAX_PRIO, nla, NULL);
886 if (event == RTM_DELACTION && n->nlmsg_flags & NLM_F_ROOT) {
888 return tca_action_flush(net, tb[1], n, portid);
893 for (i = 1; i <= TCA_ACT_MAX_PRIO && tb[i]; i++) {
894 act = tcf_action_get_1(net, tb[i], n, portid);
900 list_add_tail(&act->list, &actions);
903 if (event == RTM_GETACTION)
904 ret = act_get_notify(net, portid, n, &actions, event);
906 ret = tcf_del_notify(net, n, &actions, portid);
912 if (event != RTM_GETACTION)
913 tcf_action_destroy(&actions, 0);
918 tcf_add_notify(struct net *net, struct nlmsghdr *n, struct list_head *actions,
924 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
928 if (tca_get_fill(skb, actions, portid, n->nlmsg_seq, n->nlmsg_flags,
929 RTM_NEWACTION, 0, 0) <= 0) {
934 err = rtnetlink_send(skb, net, portid, RTNLGRP_TC,
935 n->nlmsg_flags & NLM_F_ECHO);
941 static int tcf_action_add(struct net *net, struct nlattr *nla,
942 struct nlmsghdr *n, u32 portid, int ovr)
947 ret = tcf_action_init(net, nla, NULL, NULL, ovr, 0, &actions);
951 return tcf_add_notify(net, n, &actions, portid);
954 static int tc_ctl_action(struct sk_buff *skb, struct nlmsghdr *n)
956 struct net *net = sock_net(skb->sk);
957 struct nlattr *tca[TCA_ACT_MAX + 1];
958 u32 portid = skb ? NETLINK_CB(skb).portid : 0;
959 int ret = 0, ovr = 0;
961 if ((n->nlmsg_type != RTM_GETACTION) &&
962 !netlink_capable(skb, CAP_NET_ADMIN))
965 ret = nlmsg_parse(n, sizeof(struct tcamsg), tca, TCA_ACT_MAX, NULL);
969 if (tca[TCA_ACT_TAB] == NULL) {
970 pr_notice("tc_ctl_action: received NO action attribs\n");
974 /* n->nlmsg_flags & NLM_F_CREATE */
975 switch (n->nlmsg_type) {
977 /* we are going to assume all other flags
978 * imply create only if it doesn't exist
979 * Note that CREATE | EXCL implies that
980 * but since we want avoid ambiguity (eg when flags
981 * is zero) then just set this
983 if (n->nlmsg_flags & NLM_F_REPLACE)
986 ret = tcf_action_add(net, tca[TCA_ACT_TAB], n, portid, ovr);
991 ret = tca_action_gd(net, tca[TCA_ACT_TAB], n,
992 portid, RTM_DELACTION);
995 ret = tca_action_gd(net, tca[TCA_ACT_TAB], n,
996 portid, RTM_GETACTION);
1005 static struct nlattr *find_dump_kind(const struct nlmsghdr *n)
1007 struct nlattr *tb1, *tb2[TCA_ACT_MAX + 1];
1008 struct nlattr *tb[TCA_ACT_MAX_PRIO + 1];
1009 struct nlattr *nla[TCAA_MAX + 1];
1010 struct nlattr *kind;
1012 if (nlmsg_parse(n, sizeof(struct tcamsg), nla, TCAA_MAX, NULL) < 0)
1014 tb1 = nla[TCA_ACT_TAB];
1018 if (nla_parse(tb, TCA_ACT_MAX_PRIO, nla_data(tb1),
1019 NLMSG_ALIGN(nla_len(tb1)), NULL) < 0)
1024 if (nla_parse_nested(tb2, TCA_ACT_MAX, tb[1], NULL) < 0)
1026 kind = tb2[TCA_ACT_KIND];
1031 static int tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb)
1033 struct net *net = sock_net(skb->sk);
1034 struct nlmsghdr *nlh;
1035 unsigned char *b = skb_tail_pointer(skb);
1036 struct nlattr *nest;
1037 struct tc_action_ops *a_o;
1039 struct tcamsg *t = (struct tcamsg *) nlmsg_data(cb->nlh);
1040 struct nlattr *kind = find_dump_kind(cb->nlh);
1043 pr_info("tc_dump_action: action bad kind\n");
1047 a_o = tc_lookup_action(kind);
1051 nlh = nlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq,
1052 cb->nlh->nlmsg_type, sizeof(*t), 0);
1054 goto out_module_put;
1055 t = nlmsg_data(nlh);
1056 t->tca_family = AF_UNSPEC;
1060 nest = nla_nest_start(skb, TCA_ACT_TAB);
1062 goto out_module_put;
1064 ret = a_o->walk(net, skb, cb, RTM_GETACTION, a_o);
1066 goto out_module_put;
1069 nla_nest_end(skb, nest);
1074 nlh->nlmsg_len = skb_tail_pointer(skb) - b;
1075 if (NETLINK_CB(cb->skb).portid && ret)
1076 nlh->nlmsg_flags |= NLM_F_MULTI;
1077 module_put(a_o->owner);
1081 module_put(a_o->owner);
1086 static int __init tc_action_init(void)
1088 rtnl_register(PF_UNSPEC, RTM_NEWACTION, tc_ctl_action, NULL, NULL);
1089 rtnl_register(PF_UNSPEC, RTM_DELACTION, tc_ctl_action, NULL, NULL);
1090 rtnl_register(PF_UNSPEC, RTM_GETACTION, tc_ctl_action, tc_dump_action,
1096 subsys_initcall(tc_action_init);