diff options
author | Patrick McHardy <kaber@trash.net> | 2008-01-24 05:34:11 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-29 00:11:18 +0100 |
commit | 4b3550ef530cfc153fa91f0b37cbda448bad11c6 (patch) | |
tree | 02aba7497298f220629af8e47f48e56df86d428f /net/sched/cls_api.c | |
parent | [NET_SCHED]: Propagate nla_parse return value (diff) | |
download | linux-4b3550ef530cfc153fa91f0b37cbda448bad11c6.tar.xz linux-4b3550ef530cfc153fa91f0b37cbda448bad11c6.zip |
[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.c | 14 |
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, * to work with both old and new modes of entering * tc data even if iproute2 was newer - jhs */ - struct nlattr *p_rta = (struct nlattr *)skb_tail_pointer(skb); + struct nlattr *nest; if (exts->action->type != TCA_OLD_COMPAT) { - NLA_PUT(skb, map->action, 0, NULL); + nest = nla_nest_start(skb, map->action); + if (nest == NULL) + goto nla_put_failure; if (tcf_action_dump(skb, exts->action, 0, 0) < 0) goto nla_put_failure; - p_rta->nla_len = skb_tail_pointer(skb) - (u8 *)p_rta; + nla_nest_end(skb, nest); } else if (map->police) { - NLA_PUT(skb, map->police, 0, NULL); + nest = nla_nest_start(skb, map->police); + if (nest == NULL) + goto nla_put_failure; if (tcf_action_dump_old(skb, exts->action, 0, 0) < 0) goto nla_put_failure; - p_rta->nla_len = skb_tail_pointer(skb) - (u8 *)p_rta; + nla_nest_end(skb, nest); } } #endif |