Commit 242ddfc0 authored by David S. Miller's avatar David S. Miller

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: default avatarDavid S. Miller <davem@davemloft.net>
parent 5e8d1eb5
...@@ -321,10 +321,11 @@ gre_timeout_obj_to_nlattr(struct sk_buff *skb, const void *data) ...@@ -321,10 +321,11 @@ gre_timeout_obj_to_nlattr(struct sk_buff *skb, const void *data)
{ {
const unsigned int *timeouts = data; const unsigned int *timeouts = data;
NLA_PUT_BE32(skb, CTA_TIMEOUT_GRE_UNREPLIED, if (nla_put_be32(skb, CTA_TIMEOUT_GRE_UNREPLIED,
htonl(timeouts[GRE_CT_UNREPLIED] / HZ)); htonl(timeouts[GRE_CT_UNREPLIED] / HZ)) ||
NLA_PUT_BE32(skb, CTA_TIMEOUT_GRE_REPLIED, nla_put_be32(skb, CTA_TIMEOUT_GRE_REPLIED,
htonl(timeouts[GRE_CT_REPLIED] / HZ)); htonl(timeouts[GRE_CT_REPLIED] / HZ)))
goto nla_put_failure;
return 0; return 0;
nla_put_failure: nla_put_failure:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment