aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/act_mirred.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2008-01-23 01:11:50 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:11:11 -0500
commit7ba699c604ab811972eee2e041fd6b07659a2e6e (patch)
tree4f76f69a25ce27ee0dd0c417df75acf00b1a36a0 /net/sched/act_mirred.c
parentadd93b610a4e66d36d0cf0b2596c3d3bcfdaee39 (diff)
[NET_SCHED]: Convert actions from rtnetlink to new netlink API
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/act_mirred.c')
-rw-r--r--net/sched/act_mirred.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index c3fde9180f9..db943a8c738 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
57static int tcf_mirred_init(struct rtattr *rta, struct rtattr *est, 57static 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
217rtattr_failure: 217nla_put_failure:
218 nlmsg_trim(skb, b); 218 nlmsg_trim(skb, b);
219 return -1; 219 return -1;
220} 220}