aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/cls_tcindex.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/cls_tcindex.c')
-rw-r--r--net/sched/cls_tcindex.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c
index dbe199234c63..fe29420d0b0e 100644
--- a/net/sched/cls_tcindex.c
+++ b/net/sched/cls_tcindex.c
@@ -438,10 +438,11 @@ static int tcindex_dump(struct tcf_proto *tp, unsigned long fh,
438 438
439 if (!fh) { 439 if (!fh) {
440 t->tcm_handle = ~0; /* whatever ... */ 440 t->tcm_handle = ~0; /* whatever ... */
441 NLA_PUT_U32(skb, TCA_TCINDEX_HASH, p->hash); 441 if (nla_put_u32(skb, TCA_TCINDEX_HASH, p->hash) ||
442 NLA_PUT_U16(skb, TCA_TCINDEX_MASK, p->mask); 442 nla_put_u16(skb, TCA_TCINDEX_MASK, p->mask) ||
443 NLA_PUT_U32(skb, TCA_TCINDEX_SHIFT, p->shift); 443 nla_put_u32(skb, TCA_TCINDEX_SHIFT, p->shift) ||
444 NLA_PUT_U32(skb, TCA_TCINDEX_FALL_THROUGH, p->fall_through); 444 nla_put_u32(skb, TCA_TCINDEX_FALL_THROUGH, p->fall_through))
445 goto nla_put_failure;
445 nla_nest_end(skb, nest); 446 nla_nest_end(skb, nest);
446 } else { 447 } else {
447 if (p->perfect) { 448 if (p->perfect) {
@@ -460,8 +461,9 @@ static int tcindex_dump(struct tcf_proto *tp, unsigned long fh,
460 } 461 }
461 } 462 }
462 pr_debug("handle = %d\n", t->tcm_handle); 463 pr_debug("handle = %d\n", t->tcm_handle);
463 if (r->res.class) 464 if (r->res.class &&
464 NLA_PUT_U32(skb, TCA_TCINDEX_CLASSID, r->res.classid); 465 nla_put_u32(skb, TCA_TCINDEX_CLASSID, r->res.classid))
466 goto nla_put_failure;
465 467
466 if (tcf_exts_dump(skb, &r->exts, &tcindex_ext_map) < 0) 468 if (tcf_exts_dump(skb, &r->exts, &tcindex_ext_map) < 0)
467 goto nla_put_failure; 469 goto nla_put_failure;