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/ipmr.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/ipmr.c')
-rw-r--r-- | net/ipv4/ipmr.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index 0518a4fb177b..dcf4d7fe3917 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
@@ -2120,15 +2120,16 @@ static int ipmr_fill_mroute(struct mr_table *mrt, struct sk_buff *skb, | |||
2120 | rtm->rtm_src_len = 32; | 2120 | rtm->rtm_src_len = 32; |
2121 | rtm->rtm_tos = 0; | 2121 | rtm->rtm_tos = 0; |
2122 | rtm->rtm_table = mrt->id; | 2122 | rtm->rtm_table = mrt->id; |
2123 | NLA_PUT_U32(skb, RTA_TABLE, mrt->id); | 2123 | if (nla_put_u32(skb, RTA_TABLE, mrt->id)) |
2124 | goto nla_put_failure; | ||
2124 | rtm->rtm_type = RTN_MULTICAST; | 2125 | rtm->rtm_type = RTN_MULTICAST; |
2125 | rtm->rtm_scope = RT_SCOPE_UNIVERSE; | 2126 | rtm->rtm_scope = RT_SCOPE_UNIVERSE; |
2126 | rtm->rtm_protocol = RTPROT_UNSPEC; | 2127 | rtm->rtm_protocol = RTPROT_UNSPEC; |
2127 | rtm->rtm_flags = 0; | 2128 | rtm->rtm_flags = 0; |
2128 | 2129 | ||
2129 | NLA_PUT_BE32(skb, RTA_SRC, c->mfc_origin); | 2130 | if (nla_put_be32(skb, RTA_SRC, c->mfc_origin) || |
2130 | NLA_PUT_BE32(skb, RTA_DST, c->mfc_mcastgrp); | 2131 | nla_put_be32(skb, RTA_DST, c->mfc_mcastgrp)) |
2131 | 2132 | goto nla_put_failure; | |
2132 | if (__ipmr_fill_mroute(mrt, skb, c, rtm) < 0) | 2133 | if (__ipmr_fill_mroute(mrt, skb, c, rtm) < 0) |
2133 | goto nla_put_failure; | 2134 | goto nla_put_failure; |
2134 | 2135 | ||