aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/act_skbedit.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/act_skbedit.c')
-rw-r--r--net/sched/act_skbedit.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c
index 35dbbe91027..476e0fac671 100644
--- a/net/sched/act_skbedit.c
+++ b/net/sched/act_skbedit.c
@@ -166,20 +166,25 @@ static int tcf_skbedit_dump(struct sk_buff *skb, struct tc_action *a,
166 }; 166 };
167 struct tcf_t t; 167 struct tcf_t t;
168 168
169 NLA_PUT(skb, TCA_SKBEDIT_PARMS, sizeof(opt), &opt); 169 if (nla_put(skb, TCA_SKBEDIT_PARMS, sizeof(opt), &opt))
170 if (d->flags & SKBEDIT_F_PRIORITY) 170 goto nla_put_failure;
171 NLA_PUT(skb, TCA_SKBEDIT_PRIORITY, sizeof(d->priority), 171 if ((d->flags & SKBEDIT_F_PRIORITY) &&
172 &d->priority); 172 nla_put(skb, TCA_SKBEDIT_PRIORITY, sizeof(d->priority),
173 if (d->flags & SKBEDIT_F_QUEUE_MAPPING) 173 &d->priority))
174 NLA_PUT(skb, TCA_SKBEDIT_QUEUE_MAPPING, 174 goto nla_put_failure;
175 sizeof(d->queue_mapping), &d->queue_mapping); 175 if ((d->flags & SKBEDIT_F_QUEUE_MAPPING) &&
176 if (d->flags & SKBEDIT_F_MARK) 176 nla_put(skb, TCA_SKBEDIT_QUEUE_MAPPING,
177 NLA_PUT(skb, TCA_SKBEDIT_MARK, sizeof(d->mark), 177 sizeof(d->queue_mapping), &d->queue_mapping))
178 &d->mark); 178 goto nla_put_failure;
179 if ((d->flags & SKBEDIT_F_MARK) &&
180 nla_put(skb, TCA_SKBEDIT_MARK, sizeof(d->mark),
181 &d->mark))
182 goto nla_put_failure;
179 t.install = jiffies_to_clock_t(jiffies - d->tcf_tm.install); 183 t.install = jiffies_to_clock_t(jiffies - d->tcf_tm.install);
180 t.lastuse = jiffies_to_clock_t(jiffies - d->tcf_tm.lastuse); 184 t.lastuse = jiffies_to_clock_t(jiffies - d->tcf_tm.lastuse);
181 t.expires = jiffies_to_clock_t(d->tcf_tm.expires); 185 t.expires = jiffies_to_clock_t(d->tcf_tm.expires);
182 NLA_PUT(skb, TCA_SKBEDIT_TM, sizeof(t), &t); 186 if (nla_put(skb, TCA_SKBEDIT_TM, sizeof(t), &t))
187 goto nla_put_failure;
183 return skb->len; 188 return skb->len;
184 189
185nla_put_failure: 190nla_put_failure: