aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_netem.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/sch_netem.c')
-rw-r--r--net/sched/sch_netem.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index 64f0d3293b49..d367783f6920 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -562,8 +562,7 @@ static void netem_destroy(struct Qdisc *sch)
562static int netem_dump(struct Qdisc *sch, struct sk_buff *skb) 562static int netem_dump(struct Qdisc *sch, struct sk_buff *skb)
563{ 563{
564 const struct netem_sched_data *q = qdisc_priv(sch); 564 const struct netem_sched_data *q = qdisc_priv(sch);
565 unsigned char *b = skb_tail_pointer(skb); 565 struct nlattr *nla = (struct nlattr *) skb_tail_pointer(skb);
566 struct nlattr *nla = (struct nlattr *) b;
567 struct tc_netem_qopt qopt; 566 struct tc_netem_qopt qopt;
568 struct tc_netem_corr cor; 567 struct tc_netem_corr cor;
569 struct tc_netem_reorder reorder; 568 struct tc_netem_reorder reorder;
@@ -590,12 +589,10 @@ static int netem_dump(struct Qdisc *sch, struct sk_buff *skb)
590 corrupt.correlation = q->corrupt_cor.rho; 589 corrupt.correlation = q->corrupt_cor.rho;
591 NLA_PUT(skb, TCA_NETEM_CORRUPT, sizeof(corrupt), &corrupt); 590 NLA_PUT(skb, TCA_NETEM_CORRUPT, sizeof(corrupt), &corrupt);
592 591
593 nla->nla_len = skb_tail_pointer(skb) - b; 592 return nla_nest_end(skb, nla);
594
595 return skb->len;
596 593
597nla_put_failure: 594nla_put_failure:
598 nlmsg_trim(skb, b); 595 nlmsg_trim(skb, nla);
599 return -1; 596 return -1;
600} 597}
601 598