Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 57e1c487 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller
Browse files

[NET_SCHED]: Use NLA_PUT_STRING for string dumping

parent 4b3550ef
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -121,7 +121,7 @@ static int tcf_del_walker(struct sk_buff *skb, struct tc_action *a,
	nest = nla_nest_start(skb, a->order);
	nest = nla_nest_start(skb, a->order);
	if (nest == NULL)
	if (nest == NULL)
		goto nla_put_failure;
		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++) {
	for (i = 0; i < (hinfo->hmask + 1); i++) {
		p = hinfo->htab[tcf_hash(i, hinfo->hmask)];
		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)
	if (a->ops == NULL || a->ops->dump == NULL)
		return err;
		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))
	if (tcf_action_copy_stats(skb, a, 0))
		goto nla_put_failure;
		goto nla_put_failure;
	nest = nla_nest_start(skb, TCA_OPTIONS);
	nest = nla_nest_start(skb, TCA_OPTIONS);
+1 −1
Original line number Original line Diff line number Diff line
@@ -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_INDEX, 4, &ipt->tcf_index);
	NLA_PUT(skb, TCA_IPT_HOOK, 4, &ipt->tcfi_hook);
	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_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.install = jiffies_to_clock_t(jiffies - ipt->tcf_tm.install);
	tm.lastuse = jiffies_to_clock_t(jiffies - ipt->tcf_tm.lastuse);
	tm.lastuse = jiffies_to_clock_t(jiffies - ipt->tcf_tm.lastuse);
	tm.expires = jiffies_to_clock_t(ipt->tcf_tm.expires);
	tm.expires = jiffies_to_clock_t(ipt->tcf_tm.expires);
+1 −1
Original line number Original line Diff line number Diff line
@@ -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_ifindex = tp->q->dev->ifindex;
	tcm->tcm_parent = tp->classid;
	tcm->tcm_parent = tp->classid;
	tcm->tcm_info = TC_H_MAKE(tp->prio, tp->protocol);
	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;
	tcm->tcm_handle = fh;
	if (RTM_DELTFILTER != event) {
	if (RTM_DELTFILTER != event) {
		tcm->tcm_handle = 0;
		tcm->tcm_handle = 0;
+1 −1
Original line number Original line Diff line number Diff line
@@ -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);
		NLA_PUT(skb, TCA_FW_CLASSID, 4, &f->res.classid);
#ifdef CONFIG_NET_CLS_IND
#ifdef CONFIG_NET_CLS_IND
	if (strlen(f->indev))
	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 */
#endif /* CONFIG_NET_CLS_IND */
	if (head->mask != 0xFFFFFFFF)
	if (head->mask != 0xFFFFFFFF)
		NLA_PUT(skb, TCA_FW_MASK, 4, &head->mask);
		NLA_PUT(skb, TCA_FW_MASK, 4, &head->mask);
+1 −1
Original line number Original line Diff line number Diff line
@@ -732,7 +732,7 @@ static int u32_dump(struct tcf_proto *tp, unsigned long fh,


#ifdef CONFIG_NET_CLS_IND
#ifdef CONFIG_NET_CLS_IND
		if(strlen(n->indev))
		if(strlen(n->indev))
			NLA_PUT(skb, TCA_U32_INDEV, IFNAMSIZ, n->indev);
			NLA_PUT_STRING(skb, TCA_U32_INDEV, n->indev);
#endif
#endif
#ifdef CONFIG_CLS_U32_PERF
#ifdef CONFIG_CLS_U32_PERF
		NLA_PUT(skb, TCA_U32_PCNT,
		NLA_PUT(skb, TCA_U32_PCNT,
Loading