diff options
author | David S. Miller <davem@davemloft.net> | 2012-04-01 20:39:02 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-02 04:33:43 -0400 |
commit | f3756b79e8f76cb92830383c215deba146fe0a26 (patch) | |
tree | 107c0e99681a0b26b2e750b3fc7a0b01ba1404aa /net/ipv4/fib_rules.c | |
parent | e549a6b3a5acff66f0427091e44f814943a26a86 (diff) |
ipv4: 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>
Diffstat (limited to 'net/ipv4/fib_rules.c')
-rw-r--r-- | net/ipv4/fib_rules.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c index 799fc790b3cf..2d043f71ef70 100644 --- a/net/ipv4/fib_rules.c +++ b/net/ipv4/fib_rules.c | |||
@@ -221,15 +221,15 @@ static int fib4_rule_fill(struct fib_rule *rule, struct sk_buff *skb, | |||
221 | frh->src_len = rule4->src_len; | 221 | frh->src_len = rule4->src_len; |
222 | frh->tos = rule4->tos; | 222 | frh->tos = rule4->tos; |
223 | 223 | ||
224 | if (rule4->dst_len) | 224 | if ((rule4->dst_len && |
225 | NLA_PUT_BE32(skb, FRA_DST, rule4->dst); | 225 | nla_put_be32(skb, FRA_DST, rule4->dst)) || |
226 | 226 | (rule4->src_len && | |
227 | if (rule4->src_len) | 227 | nla_put_be32(skb, FRA_SRC, rule4->src))) |
228 | NLA_PUT_BE32(skb, FRA_SRC, rule4->src); | 228 | goto nla_put_failure; |
229 | |||
230 | #ifdef CONFIG_IP_ROUTE_CLASSID | 229 | #ifdef CONFIG_IP_ROUTE_CLASSID |
231 | if (rule4->tclassid) | 230 | if (rule4->tclassid && |
232 | NLA_PUT_U32(skb, FRA_FLOW, rule4->tclassid); | 231 | nla_put_u32(skb, FRA_FLOW, rule4->tclassid)) |
232 | goto nla_put_failure; | ||
233 | #endif | 233 | #endif |
234 | return 0; | 234 | return 0; |
235 | 235 | ||