diff options
author | David S. Miller <davem@davemloft.net> | 2012-04-01 18:52:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-01 18:52:03 -0400 |
commit | 242ddfc01499e83cd1e65e1dddb8c96b7f2ba2cc (patch) | |
tree | a5de3ceb8b1205f6f1eb3cb98fc19e548def3d65 /net | |
parent | 5e8d1eb5fb51e5b9d266a611133fea808320ab97 (diff) |
nf_conntrack_proto_gre: 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')
-rw-r--r-- | net/netfilter/nf_conntrack_proto_gre.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/netfilter/nf_conntrack_proto_gre.c b/net/netfilter/nf_conntrack_proto_gre.c index 659648c4b14a..4bf6b4e4b776 100644 --- a/net/netfilter/nf_conntrack_proto_gre.c +++ b/net/netfilter/nf_conntrack_proto_gre.c | |||
@@ -321,10 +321,11 @@ gre_timeout_obj_to_nlattr(struct sk_buff *skb, const void *data) | |||
321 | { | 321 | { |
322 | const unsigned int *timeouts = data; | 322 | const unsigned int *timeouts = data; |
323 | 323 | ||
324 | NLA_PUT_BE32(skb, CTA_TIMEOUT_GRE_UNREPLIED, | 324 | if (nla_put_be32(skb, CTA_TIMEOUT_GRE_UNREPLIED, |
325 | htonl(timeouts[GRE_CT_UNREPLIED] / HZ)); | 325 | htonl(timeouts[GRE_CT_UNREPLIED] / HZ)) || |
326 | NLA_PUT_BE32(skb, CTA_TIMEOUT_GRE_REPLIED, | 326 | nla_put_be32(skb, CTA_TIMEOUT_GRE_REPLIED, |
327 | htonl(timeouts[GRE_CT_REPLIED] / HZ)); | 327 | htonl(timeouts[GRE_CT_REPLIED] / HZ))) |
328 | goto nla_put_failure; | ||
328 | return 0; | 329 | return 0; |
329 | 330 | ||
330 | nla_put_failure: | 331 | nla_put_failure: |