diff options
Diffstat (limited to 'net/sched/act_mirred.c')
-rw-r--r-- | net/sched/act_mirred.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c index c3fde9180f9d..db943a8c7388 100644 --- a/net/sched/act_mirred.c +++ b/net/sched/act_mirred.c | |||
@@ -54,10 +54,10 @@ static inline int tcf_mirred_release(struct tcf_mirred *m, int bind) | |||
54 | return 0; | 54 | return 0; |
55 | } | 55 | } |
56 | 56 | ||
57 | static int tcf_mirred_init(struct rtattr *rta, struct rtattr *est, | 57 | static int tcf_mirred_init(struct nlattr *nla, struct nlattr *est, |
58 | struct tc_action *a, int ovr, int bind) | 58 | struct tc_action *a, int ovr, int bind) |
59 | { | 59 | { |
60 | struct rtattr *tb[TCA_MIRRED_MAX]; | 60 | struct nlattr *tb[TCA_MIRRED_MAX + 1]; |
61 | struct tc_mirred *parm; | 61 | struct tc_mirred *parm; |
62 | struct tcf_mirred *m; | 62 | struct tcf_mirred *m; |
63 | struct tcf_common *pc; | 63 | struct tcf_common *pc; |
@@ -65,13 +65,13 @@ static int tcf_mirred_init(struct rtattr *rta, struct rtattr *est, | |||
65 | int ret = 0; | 65 | int ret = 0; |
66 | int ok_push = 0; | 66 | int ok_push = 0; |
67 | 67 | ||
68 | if (rta == NULL || rtattr_parse_nested(tb, TCA_MIRRED_MAX, rta) < 0) | 68 | if (nla == NULL || nla_parse_nested(tb, TCA_MIRRED_MAX, nla, NULL) < 0) |
69 | return -EINVAL; | 69 | return -EINVAL; |
70 | 70 | ||
71 | if (tb[TCA_MIRRED_PARMS-1] == NULL || | 71 | if (tb[TCA_MIRRED_PARMS] == NULL || |
72 | RTA_PAYLOAD(tb[TCA_MIRRED_PARMS-1]) < sizeof(*parm)) | 72 | nla_len(tb[TCA_MIRRED_PARMS]) < sizeof(*parm)) |
73 | return -EINVAL; | 73 | return -EINVAL; |
74 | parm = RTA_DATA(tb[TCA_MIRRED_PARMS-1]); | 74 | parm = nla_data(tb[TCA_MIRRED_PARMS]); |
75 | 75 | ||
76 | if (parm->ifindex) { | 76 | if (parm->ifindex) { |
77 | dev = __dev_get_by_index(&init_net, parm->ifindex); | 77 | dev = __dev_get_by_index(&init_net, parm->ifindex); |
@@ -207,14 +207,14 @@ static int tcf_mirred_dump(struct sk_buff *skb, struct tc_action *a, int bind, i | |||
207 | opt.bindcnt = m->tcf_bindcnt - bind; | 207 | opt.bindcnt = m->tcf_bindcnt - bind; |
208 | opt.eaction = m->tcfm_eaction; | 208 | opt.eaction = m->tcfm_eaction; |
209 | opt.ifindex = m->tcfm_ifindex; | 209 | opt.ifindex = m->tcfm_ifindex; |
210 | RTA_PUT(skb, TCA_MIRRED_PARMS, sizeof(opt), &opt); | 210 | NLA_PUT(skb, TCA_MIRRED_PARMS, sizeof(opt), &opt); |
211 | t.install = jiffies_to_clock_t(jiffies - m->tcf_tm.install); | 211 | t.install = jiffies_to_clock_t(jiffies - m->tcf_tm.install); |
212 | t.lastuse = jiffies_to_clock_t(jiffies - m->tcf_tm.lastuse); | 212 | t.lastuse = jiffies_to_clock_t(jiffies - m->tcf_tm.lastuse); |
213 | t.expires = jiffies_to_clock_t(m->tcf_tm.expires); | 213 | t.expires = jiffies_to_clock_t(m->tcf_tm.expires); |
214 | RTA_PUT(skb, TCA_MIRRED_TM, sizeof(t), &t); | 214 | NLA_PUT(skb, TCA_MIRRED_TM, sizeof(t), &t); |
215 | return skb->len; | 215 | return skb->len; |
216 | 216 | ||
217 | rtattr_failure: | 217 | nla_put_failure: |
218 | nlmsg_trim(skb, b); | 218 | nlmsg_trim(skb, b); |
219 | return -1; | 219 | return -1; |
220 | } | 220 | } |