diff options
author | David S. Miller <davem@davemloft.net> | 2012-04-01 20:27:33 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-02 04:33:43 -0400 |
commit | c78679e8f31b86c7a46e77a3096011f911854187 (patch) | |
tree | 511b7a8e07c89a6ca7936c1ed3cb26300d8fe6a5 /net/ipv6/fib6_rules.c | |
parent | 86ebb02dc793058ea17ad647c802b507dafff7cb (diff) |
ipv6: 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/ipv6/fib6_rules.c')
-rw-r--r-- | net/ipv6/fib6_rules.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c index b6c573152067..01a2de1f5e87 100644 --- a/net/ipv6/fib6_rules.c +++ b/net/ipv6/fib6_rules.c | |||
@@ -215,14 +215,13 @@ static int fib6_rule_fill(struct fib_rule *rule, struct sk_buff *skb, | |||
215 | frh->src_len = rule6->src.plen; | 215 | frh->src_len = rule6->src.plen; |
216 | frh->tos = rule6->tclass; | 216 | frh->tos = rule6->tclass; |
217 | 217 | ||
218 | if (rule6->dst.plen) | 218 | if ((rule6->dst.plen && |
219 | NLA_PUT(skb, FRA_DST, sizeof(struct in6_addr), | 219 | nla_put(skb, FRA_DST, sizeof(struct in6_addr), |
220 | &rule6->dst.addr); | 220 | &rule6->dst.addr)) || |
221 | 221 | (rule6->src.plen && | |
222 | if (rule6->src.plen) | 222 | nla_put(skb, FRA_SRC, sizeof(struct in6_addr), |
223 | NLA_PUT(skb, FRA_SRC, sizeof(struct in6_addr), | 223 | &rule6->src.addr))) |
224 | &rule6->src.addr); | 224 | goto nla_put_failure; |
225 | |||
226 | return 0; | 225 | return 0; |
227 | 226 | ||
228 | nla_put_failure: | 227 | nla_put_failure: |