aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ip6mr.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-04-01 20:27:33 -0400
committerDavid S. Miller <davem@davemloft.net>2012-04-02 04:33:43 -0400
commitc78679e8f31b86c7a46e77a3096011f911854187 (patch)
tree511b7a8e07c89a6ca7936c1ed3cb26300d8fe6a5 /net/ipv6/ip6mr.c
parent86ebb02dc793058ea17ad647c802b507dafff7cb (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/ip6mr.c')
-rw-r--r--net/ipv6/ip6mr.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 5aa3981a3922..ff6ddf93f269 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -2216,14 +2216,15 @@ static int ip6mr_fill_mroute(struct mr6_table *mrt, struct sk_buff *skb,
2216 rtm->rtm_src_len = 128; 2216 rtm->rtm_src_len = 128;
2217 rtm->rtm_tos = 0; 2217 rtm->rtm_tos = 0;
2218 rtm->rtm_table = mrt->id; 2218 rtm->rtm_table = mrt->id;
2219 NLA_PUT_U32(skb, RTA_TABLE, mrt->id); 2219 if (nla_put_u32(skb, RTA_TABLE, mrt->id))
2220 goto nla_put_failure;
2220 rtm->rtm_scope = RT_SCOPE_UNIVERSE; 2221 rtm->rtm_scope = RT_SCOPE_UNIVERSE;
2221 rtm->rtm_protocol = RTPROT_UNSPEC; 2222 rtm->rtm_protocol = RTPROT_UNSPEC;
2222 rtm->rtm_flags = 0; 2223 rtm->rtm_flags = 0;
2223 2224
2224 NLA_PUT(skb, RTA_SRC, 16, &c->mf6c_origin); 2225 if (nla_put(skb, RTA_SRC, 16, &c->mf6c_origin) ||
2225 NLA_PUT(skb, RTA_DST, 16, &c->mf6c_mcastgrp); 2226 nla_put(skb, RTA_DST, 16, &c->mf6c_mcastgrp))
2226 2227 goto nla_put_failure;
2227 if (__ip6mr_fill_mroute(mrt, skb, c, rtm) < 0) 2228 if (__ip6mr_fill_mroute(mrt, skb, c, rtm) < 0)
2228 goto nla_put_failure; 2229 goto nla_put_failure;
2229 2230