projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5e8d1eb
)
nf_conntrack_proto_gre: Stop using NLA_PUT*().
author
David S. Miller
<davem@davemloft.net>
Sun, 1 Apr 2012 22:52:03 +0000
(18:52 -0400)
committer
David S. Miller
<davem@davemloft.net>
Sun, 1 Apr 2012 22:52:03 +0000
(18:52 -0400)
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>
net/netfilter/nf_conntrack_proto_gre.c
patch
|
blob
|
history
diff --git
a/net/netfilter/nf_conntrack_proto_gre.c
b/net/netfilter/nf_conntrack_proto_gre.c
index 659648c4b14ad50331c996ab6a401e379b23b700..4bf6b4e4b7763197c5698db8993e5362c5ef0911 100644
(file)
--- 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)
{
const unsigned int *timeouts = data;
- NLA_PUT_BE32(skb, CTA_TIMEOUT_GRE_UNREPLIED,
- htonl(timeouts[GRE_CT_UNREPLIED] / HZ));
- NLA_PUT_BE32(skb, CTA_TIMEOUT_GRE_REPLIED,
- htonl(timeouts[GRE_CT_REPLIED] / HZ));
+ if (nla_put_be32(skb, CTA_TIMEOUT_GRE_UNREPLIED,
+ htonl(timeouts[GRE_CT_UNREPLIED] / HZ)) ||
+ nla_put_be32(skb, CTA_TIMEOUT_GRE_REPLIED,
+ htonl(timeouts[GRE_CT_REPLIED] / HZ)))
+ goto nla_put_failure;
return 0;
nla_put_failure: