summaryrefslogtreecommitdiff
path: root/net/ipv6/ndisc.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-04-02 00:27:33 (GMT)
committerDavid S. Miller <davem@davemloft.net>2012-04-02 08:33:43 (GMT)
commitc78679e8f31b86c7a46e77a3096011f911854187 (patch)
tree511b7a8e07c89a6ca7936c1ed3cb26300d8fe6a5 /net/ipv6/ndisc.c
parent86ebb02dc793058ea17ad647c802b507dafff7cb (diff)
downloadlinux-fsl-qoriq-c78679e8f31b86c7a46e77a3096011f911854187.tar.xz
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/ndisc.c')
-rw-r--r--net/ipv6/ndisc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 3dcdb81..1d6fb0c 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1099,8 +1099,9 @@ static void ndisc_ra_useropt(struct sk_buff *ra, struct nd_opt_hdr *opt)
memcpy(ndmsg + 1, opt, opt->nd_opt_len << 3);
- NLA_PUT(skb, NDUSEROPT_SRCADDR, sizeof(struct in6_addr),
- &ipv6_hdr(ra)->saddr);
+ if (nla_put(skb, NDUSEROPT_SRCADDR, sizeof(struct in6_addr),
+ &ipv6_hdr(ra)->saddr))
+ goto nla_put_failure;
nlmsg_end(skb, nlh);
rtnl_notify(skb, net, 0, RTNLGRP_ND_USEROPT, NULL, GFP_ATOMIC);