mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
pkt_sched: Stop using NLA_PUT*().
These macros contain a hidden goto, and are thus extremely error prone and make code hard to audit. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
9360ffd185
commit
1b34ec43c9
40 changed files with 263 additions and 157 deletions
|
@ -571,17 +571,21 @@ static int route4_dump(struct tcf_proto *tp, unsigned long fh,
|
|||
|
||||
if (!(f->handle & 0x8000)) {
|
||||
id = f->id & 0xFF;
|
||||
NLA_PUT_U32(skb, TCA_ROUTE4_TO, id);
|
||||
if (nla_put_u32(skb, TCA_ROUTE4_TO, id))
|
||||
goto nla_put_failure;
|
||||
}
|
||||
if (f->handle & 0x80000000) {
|
||||
if ((f->handle >> 16) != 0xFFFF)
|
||||
NLA_PUT_U32(skb, TCA_ROUTE4_IIF, f->iif);
|
||||
if ((f->handle >> 16) != 0xFFFF &&
|
||||
nla_put_u32(skb, TCA_ROUTE4_IIF, f->iif))
|
||||
goto nla_put_failure;
|
||||
} else {
|
||||
id = f->id >> 16;
|
||||
NLA_PUT_U32(skb, TCA_ROUTE4_FROM, id);
|
||||
if (nla_put_u32(skb, TCA_ROUTE4_FROM, id))
|
||||
goto nla_put_failure;
|
||||
}
|
||||
if (f->res.classid)
|
||||
NLA_PUT_U32(skb, TCA_ROUTE4_CLASSID, f->res.classid);
|
||||
if (f->res.classid &&
|
||||
nla_put_u32(skb, TCA_ROUTE4_CLASSID, f->res.classid))
|
||||
goto nla_put_failure;
|
||||
|
||||
if (tcf_exts_dump(skb, &f->exts, &route_ext_map) < 0)
|
||||
goto nla_put_failure;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue