[NET_SCHED]: Use NLA_PUT_STRING for string dumping
authorPatrick McHardy <kaber@trash.net>
Thu, 24 Jan 2008 04:34:28 +0000 (20:34 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:11:19 +0000 (15:11 -0800)
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/act_api.c
net/sched/act_ipt.c
net/sched/cls_api.c
net/sched/cls_fw.c
net/sched/cls_u32.c
net/sched/sch_api.c

index 36022605fc162b1442b20f30c5aef78cd00aeaca..e33e43abe9690279e5a1eba04d26b197e66106f6 100644 (file)
@@ -121,7 +121,7 @@ static int tcf_del_walker(struct sk_buff *skb, struct tc_action *a,
        nest = nla_nest_start(skb, a->order);
        if (nest == NULL)
                goto nla_put_failure;
-       NLA_PUT(skb, TCA_KIND, IFNAMSIZ, a->ops->kind);
+       NLA_PUT_STRING(skb, TCA_KIND, a->ops->kind);
        for (i = 0; i < (hinfo->hmask + 1); i++) {
                p = hinfo->htab[tcf_hash(i, hinfo->hmask)];
 
@@ -423,7 +423,7 @@ tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
        if (a->ops == NULL || a->ops->dump == NULL)
                return err;
 
-       NLA_PUT(skb, TCA_KIND, IFNAMSIZ, a->ops->kind);
+       NLA_PUT_STRING(skb, TCA_KIND, a->ops->kind);
        if (tcf_action_copy_stats(skb, a, 0))
                goto nla_put_failure;
        nest = nla_nest_start(skb, TCA_OPTIONS);
index 12693347d56a871c85ac019d95c6cbd821dd0464..ecda51da9c1475b310d09a278a71aa32434ba3de 100644 (file)
@@ -257,7 +257,7 @@ static int tcf_ipt_dump(struct sk_buff *skb, struct tc_action *a, int bind, int
        NLA_PUT(skb, TCA_IPT_INDEX, 4, &ipt->tcf_index);
        NLA_PUT(skb, TCA_IPT_HOOK, 4, &ipt->tcfi_hook);
        NLA_PUT(skb, TCA_IPT_CNT, sizeof(struct tc_cnt), &c);
-       NLA_PUT(skb, TCA_IPT_TABLE, IFNAMSIZ, ipt->tcfi_tname);
+       NLA_PUT_STRING(skb, TCA_IPT_TABLE, ipt->tcfi_tname);
        tm.install = jiffies_to_clock_t(jiffies - ipt->tcf_tm.install);
        tm.lastuse = jiffies_to_clock_t(jiffies - ipt->tcf_tm.lastuse);
        tm.expires = jiffies_to_clock_t(ipt->tcf_tm.expires);
index 5584e7cd4b9f5898f4e289f02660845834b471c3..3377ca0d0a0c8470bc13e539fb4047820ed20b85 100644 (file)
@@ -337,7 +337,7 @@ static int tcf_fill_node(struct sk_buff *skb, struct tcf_proto *tp,
        tcm->tcm_ifindex = tp->q->dev->ifindex;
        tcm->tcm_parent = tp->classid;
        tcm->tcm_info = TC_H_MAKE(tp->prio, tp->protocol);
-       NLA_PUT(skb, TCA_KIND, IFNAMSIZ, tp->ops->kind);
+       NLA_PUT_STRING(skb, TCA_KIND, tp->ops->kind);
        tcm->tcm_handle = fh;
        if (RTM_DELTFILTER != event) {
                tcm->tcm_handle = 0;
index e3dfbb3046c0cf52e44dcd58fded8da95595eba2..31074735d1bd9f95053498e1a4182b7d1bea170d 100644 (file)
@@ -352,7 +352,7 @@ static int fw_dump(struct tcf_proto *tp, unsigned long fh,
                NLA_PUT(skb, TCA_FW_CLASSID, 4, &f->res.classid);
 #ifdef CONFIG_NET_CLS_IND
        if (strlen(f->indev))
-               NLA_PUT(skb, TCA_FW_INDEV, IFNAMSIZ, f->indev);
+               NLA_PUT_STRING(skb, TCA_FW_INDEV, f->indev);
 #endif /* CONFIG_NET_CLS_IND */
        if (head->mask != 0xFFFFFFFF)
                NLA_PUT(skb, TCA_FW_MASK, 4, &head->mask);
index b51c2c324abccd28bd7ff14cb1308187c05356cb..7a1502553b301b211fdf867fcff5888021012883 100644 (file)
@@ -732,7 +732,7 @@ static int u32_dump(struct tcf_proto *tp, unsigned long fh,
 
 #ifdef CONFIG_NET_CLS_IND
                if(strlen(n->indev))
-                       NLA_PUT(skb, TCA_U32_INDEV, IFNAMSIZ, n->indev);
+                       NLA_PUT_STRING(skb, TCA_U32_INDEV, n->indev);
 #endif
 #ifdef CONFIG_CLS_U32_PERF
                NLA_PUT(skb, TCA_U32_PCNT,
index 7abb028dd96b5af3fac5f130837b61451c2cbe4a..8db554d54854405c2a280fe71f32babcea75fc3b 100644 (file)
@@ -834,7 +834,7 @@ static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid,
        tcm->tcm_parent = clid;
        tcm->tcm_handle = q->handle;
        tcm->tcm_info = atomic_read(&q->refcnt);
-       NLA_PUT(skb, TCA_KIND, IFNAMSIZ, q->ops->id);
+       NLA_PUT_STRING(skb, TCA_KIND, q->ops->id);
        if (q->ops->dump && q->ops->dump(q, skb) < 0)
                goto nla_put_failure;
        q->qstats.qlen = q->q.qlen;
@@ -1080,7 +1080,7 @@ static int tc_fill_tclass(struct sk_buff *skb, struct Qdisc *q,
        tcm->tcm_parent = q->handle;
        tcm->tcm_handle = q->handle;
        tcm->tcm_info = 0;
-       NLA_PUT(skb, TCA_KIND, IFNAMSIZ, q->ops->id);
+       NLA_PUT_STRING(skb, TCA_KIND, q->ops->id);
        if (cl_ops->dump && cl_ops->dump(q, cl, skb, tcm) < 0)
                goto nla_put_failure;