aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/cls_api.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2008-01-23 23:34:11 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:11:18 -0500
commit4b3550ef530cfc153fa91f0b37cbda448bad11c6 (patch)
tree02aba7497298f220629af8e47f48e56df86d428f /net/sched/cls_api.c
parentcee63723b358e594225e812d6e14a2a0abfd5c88 (diff)
[NET_SCHED]: Use nla_nest_start/nla_nest_end
Use nla_nest_start/nla_nest_end for dumping nested attributes. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/cls_api.c')
-rw-r--r--net/sched/cls_api.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 92fa1559c211..5584e7cd4b9f 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -544,18 +544,22 @@ int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts,
544 * to work with both old and new modes of entering 544 * to work with both old and new modes of entering
545 * tc data even if iproute2 was newer - jhs 545 * tc data even if iproute2 was newer - jhs
546 */ 546 */
547 struct nlattr *p_rta = (struct nlattr *)skb_tail_pointer(skb); 547 struct nlattr *nest;
548 548
549 if (exts->action->type != TCA_OLD_COMPAT) { 549 if (exts->action->type != TCA_OLD_COMPAT) {
550 NLA_PUT(skb, map->action, 0, NULL); 550 nest = nla_nest_start(skb, map->action);
551 if (nest == NULL)
552 goto nla_put_failure;
551 if (tcf_action_dump(skb, exts->action, 0, 0) < 0) 553 if (tcf_action_dump(skb, exts->action, 0, 0) < 0)
552 goto nla_put_failure; 554 goto nla_put_failure;
553 p_rta->nla_len = skb_tail_pointer(skb) - (u8 *)p_rta; 555 nla_nest_end(skb, nest);
554 } else if (map->police) { 556 } else if (map->police) {
555 NLA_PUT(skb, map->police, 0, NULL); 557 nest = nla_nest_start(skb, map->police);
558 if (nest == NULL)
559 goto nla_put_failure;
556 if (tcf_action_dump_old(skb, exts->action, 0, 0) < 0) 560 if (tcf_action_dump_old(skb, exts->action, 0, 0) < 0)
557 goto nla_put_failure; 561 goto nla_put_failure;
558 p_rta->nla_len = skb_tail_pointer(skb) - (u8 *)p_rta; 562 nla_nest_end(skb, nest);
559 } 563 }
560 } 564 }
561#endif 565#endif