diff options
Diffstat (limited to 'net/sched/act_api.c')
-rw-r--r-- | net/sched/act_api.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/net/sched/act_api.c b/net/sched/act_api.c index 835070e9169c..dd0868dfbd90 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c | |||
@@ -65,7 +65,7 @@ int tcf_hash_release(struct tcf_common *p, int bind, | |||
65 | p->tcfc_bindcnt--; | 65 | p->tcfc_bindcnt--; |
66 | 66 | ||
67 | p->tcfc_refcnt--; | 67 | p->tcfc_refcnt--; |
68 | if (p->tcfc_bindcnt <= 0 && p->tcfc_refcnt <= 0) { | 68 | if (p->tcfc_bindcnt <= 0 && p->tcfc_refcnt <= 0) { |
69 | tcf_hash_destroy(p, hinfo); | 69 | tcf_hash_destroy(p, hinfo); |
70 | ret = 1; | 70 | ret = 1; |
71 | } | 71 | } |
@@ -362,7 +362,7 @@ static struct tc_action_ops *tc_lookup_action_id(u32 type) | |||
362 | #endif | 362 | #endif |
363 | 363 | ||
364 | int tcf_action_exec(struct sk_buff *skb, struct tc_action *act, | 364 | int tcf_action_exec(struct sk_buff *skb, struct tc_action *act, |
365 | struct tcf_result *res) | 365 | struct tcf_result *res) |
366 | { | 366 | { |
367 | struct tc_action *a; | 367 | struct tc_action *a; |
368 | int ret = -1; | 368 | int ret = -1; |
@@ -473,7 +473,7 @@ errout: | |||
473 | } | 473 | } |
474 | 474 | ||
475 | struct tc_action *tcf_action_init_1(struct rtattr *rta, struct rtattr *est, | 475 | struct tc_action *tcf_action_init_1(struct rtattr *rta, struct rtattr *est, |
476 | char *name, int ovr, int bind, int *err) | 476 | char *name, int ovr, int bind, int *err) |
477 | { | 477 | { |
478 | struct tc_action *a; | 478 | struct tc_action *a; |
479 | struct tc_action_ops *a_o; | 479 | struct tc_action_ops *a_o; |
@@ -553,7 +553,7 @@ err_out: | |||
553 | } | 553 | } |
554 | 554 | ||
555 | struct tc_action *tcf_action_init(struct rtattr *rta, struct rtattr *est, | 555 | struct tc_action *tcf_action_init(struct rtattr *rta, struct rtattr *est, |
556 | char *name, int ovr, int bind, int *err) | 556 | char *name, int ovr, int bind, int *err) |
557 | { | 557 | { |
558 | struct rtattr *tb[TCA_ACT_MAX_PRIO+1]; | 558 | struct rtattr *tb[TCA_ACT_MAX_PRIO+1]; |
559 | struct tc_action *head = NULL, *act, *act_prev = NULL; | 559 | struct tc_action *head = NULL, *act, *act_prev = NULL; |
@@ -590,7 +590,7 @@ int tcf_action_copy_stats(struct sk_buff *skb, struct tc_action *a, | |||
590 | int err = 0; | 590 | int err = 0; |
591 | struct gnet_dump d; | 591 | struct gnet_dump d; |
592 | struct tcf_act_hdr *h = a->priv; | 592 | struct tcf_act_hdr *h = a->priv; |
593 | 593 | ||
594 | if (h == NULL) | 594 | if (h == NULL) |
595 | goto errout; | 595 | goto errout; |
596 | 596 | ||
@@ -632,7 +632,7 @@ errout: | |||
632 | 632 | ||
633 | static int | 633 | static int |
634 | tca_get_fill(struct sk_buff *skb, struct tc_action *a, u32 pid, u32 seq, | 634 | tca_get_fill(struct sk_buff *skb, struct tc_action *a, u32 pid, u32 seq, |
635 | u16 flags, int event, int bind, int ref) | 635 | u16 flags, int event, int bind, int ref) |
636 | { | 636 | { |
637 | struct tcamsg *t; | 637 | struct tcamsg *t; |
638 | struct nlmsghdr *nlh; | 638 | struct nlmsghdr *nlh; |
@@ -645,7 +645,7 @@ tca_get_fill(struct sk_buff *skb, struct tc_action *a, u32 pid, u32 seq, | |||
645 | t->tca_family = AF_UNSPEC; | 645 | t->tca_family = AF_UNSPEC; |
646 | t->tca__pad1 = 0; | 646 | t->tca__pad1 = 0; |
647 | t->tca__pad2 = 0; | 647 | t->tca__pad2 = 0; |
648 | 648 | ||
649 | x = (struct rtattr*) skb->tail; | 649 | x = (struct rtattr*) skb->tail; |
650 | RTA_PUT(skb, TCA_ACT_TAB, 0, NULL); | 650 | RTA_PUT(skb, TCA_ACT_TAB, 0, NULL); |
651 | 651 | ||
@@ -653,7 +653,7 @@ tca_get_fill(struct sk_buff *skb, struct tc_action *a, u32 pid, u32 seq, | |||
653 | goto rtattr_failure; | 653 | goto rtattr_failure; |
654 | 654 | ||
655 | x->rta_len = skb->tail - (u8*)x; | 655 | x->rta_len = skb->tail - (u8*)x; |
656 | 656 | ||
657 | nlh->nlmsg_len = skb->tail - b; | 657 | nlh->nlmsg_len = skb->tail - b; |
658 | return skb->len; | 658 | return skb->len; |
659 | 659 | ||
@@ -852,7 +852,7 @@ tca_action_gd(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int event) | |||
852 | } | 852 | } |
853 | 853 | ||
854 | if (tca_get_fill(skb, head, pid, n->nlmsg_seq, 0, event, | 854 | if (tca_get_fill(skb, head, pid, n->nlmsg_seq, 0, event, |
855 | 0, 1) <= 0) { | 855 | 0, 1) <= 0) { |
856 | kfree_skb(skb); | 856 | kfree_skb(skb); |
857 | ret = -EINVAL; | 857 | ret = -EINVAL; |
858 | goto err; | 858 | goto err; |
@@ -861,7 +861,7 @@ tca_action_gd(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int event) | |||
861 | /* now do the delete */ | 861 | /* now do the delete */ |
862 | tcf_action_destroy(head, 0); | 862 | tcf_action_destroy(head, 0); |
863 | ret = rtnetlink_send(skb, pid, RTNLGRP_TC, | 863 | ret = rtnetlink_send(skb, pid, RTNLGRP_TC, |
864 | n->nlmsg_flags&NLM_F_ECHO); | 864 | n->nlmsg_flags&NLM_F_ECHO); |
865 | if (ret > 0) | 865 | if (ret > 0) |
866 | return 0; | 866 | return 0; |
867 | return ret; | 867 | return ret; |
@@ -872,7 +872,7 @@ err: | |||
872 | } | 872 | } |
873 | 873 | ||
874 | static int tcf_add_notify(struct tc_action *a, u32 pid, u32 seq, int event, | 874 | static int tcf_add_notify(struct tc_action *a, u32 pid, u32 seq, int event, |
875 | u16 flags) | 875 | u16 flags) |
876 | { | 876 | { |
877 | struct tcamsg *t; | 877 | struct tcamsg *t; |
878 | struct nlmsghdr *nlh; | 878 | struct nlmsghdr *nlh; |
@@ -900,10 +900,10 @@ static int tcf_add_notify(struct tc_action *a, u32 pid, u32 seq, int event, | |||
900 | goto rtattr_failure; | 900 | goto rtattr_failure; |
901 | 901 | ||
902 | x->rta_len = skb->tail - (u8*)x; | 902 | x->rta_len = skb->tail - (u8*)x; |
903 | 903 | ||
904 | nlh->nlmsg_len = skb->tail - b; | 904 | nlh->nlmsg_len = skb->tail - b; |
905 | NETLINK_CB(skb).dst_group = RTNLGRP_TC; | 905 | NETLINK_CB(skb).dst_group = RTNLGRP_TC; |
906 | 906 | ||
907 | err = rtnetlink_send(skb, pid, RTNLGRP_TC, flags&NLM_F_ECHO); | 907 | err = rtnetlink_send(skb, pid, RTNLGRP_TC, flags&NLM_F_ECHO); |
908 | if (err > 0) | 908 | if (err > 0) |
909 | err = 0; | 909 | err = 0; |
@@ -915,7 +915,7 @@ nlmsg_failure: | |||
915 | return -1; | 915 | return -1; |
916 | } | 916 | } |
917 | 917 | ||
918 | 918 | ||
919 | static int | 919 | static int |
920 | tcf_action_add(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int ovr) | 920 | tcf_action_add(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int ovr) |
921 | { | 921 | { |
@@ -999,13 +999,13 @@ find_dump_kind(struct nlmsghdr *n) | |||
999 | return NULL; | 999 | return NULL; |
1000 | 1000 | ||
1001 | if (rtattr_parse(tb, TCA_ACT_MAX_PRIO, RTA_DATA(tb1), | 1001 | if (rtattr_parse(tb, TCA_ACT_MAX_PRIO, RTA_DATA(tb1), |
1002 | NLMSG_ALIGN(RTA_PAYLOAD(tb1))) < 0) | 1002 | NLMSG_ALIGN(RTA_PAYLOAD(tb1))) < 0) |
1003 | return NULL; | 1003 | return NULL; |
1004 | if (tb[0] == NULL) | 1004 | if (tb[0] == NULL) |
1005 | return NULL; | 1005 | return NULL; |
1006 | 1006 | ||
1007 | if (rtattr_parse(tb2, TCA_ACT_MAX, RTA_DATA(tb[0]), | 1007 | if (rtattr_parse(tb2, TCA_ACT_MAX, RTA_DATA(tb[0]), |
1008 | RTA_PAYLOAD(tb[0])) < 0) | 1008 | RTA_PAYLOAD(tb[0])) < 0) |
1009 | return NULL; | 1009 | return NULL; |
1010 | kind = tb2[TCA_ACT_KIND-1]; | 1010 | kind = tb2[TCA_ACT_KIND-1]; |
1011 | 1011 | ||
@@ -1043,7 +1043,7 @@ tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb) | |||
1043 | } | 1043 | } |
1044 | 1044 | ||
1045 | nlh = NLMSG_PUT(skb, NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq, | 1045 | nlh = NLMSG_PUT(skb, NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq, |
1046 | cb->nlh->nlmsg_type, sizeof(*t)); | 1046 | cb->nlh->nlmsg_type, sizeof(*t)); |
1047 | t = NLMSG_DATA(nlh); | 1047 | t = NLMSG_DATA(nlh); |
1048 | t->tca_family = AF_UNSPEC; | 1048 | t->tca_family = AF_UNSPEC; |
1049 | t->tca__pad1 = 0; | 1049 | t->tca__pad1 = 0; |