diff options
author | David S. Miller <davem@davemloft.net> | 2012-04-01 18:48:06 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-01 18:48:06 -0400 |
commit | 3c60a17b1b55ac4a72382502c952222b7649d63b (patch) | |
tree | de12d1001b5d76cb35d7ab6ccba8b61eee19efb7 /net/netfilter/nf_conntrack_proto_udplite.c | |
parent | 7c8011895330d3069b137233e2673f40ee6f4c91 (diff) | |
download | op-kernel-dev-3c60a17b1b55ac4a72382502c952222b7649d63b.zip op-kernel-dev-3c60a17b1b55ac4a72382502c952222b7649d63b.tar.gz |
nf_conntrack_proto_udp{,lite}: 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/netfilter/nf_conntrack_proto_udplite.c')
-rw-r--r-- | net/netfilter/nf_conntrack_proto_udplite.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/netfilter/nf_conntrack_proto_udplite.c b/net/netfilter/nf_conntrack_proto_udplite.c index e060639..4d60a53 100644 --- a/net/netfilter/nf_conntrack_proto_udplite.c +++ b/net/netfilter/nf_conntrack_proto_udplite.c @@ -185,10 +185,11 @@ udplite_timeout_obj_to_nlattr(struct sk_buff *skb, const void *data) { const unsigned int *timeouts = data; - NLA_PUT_BE32(skb, CTA_TIMEOUT_UDPLITE_UNREPLIED, - htonl(timeouts[UDPLITE_CT_UNREPLIED] / HZ)); - NLA_PUT_BE32(skb, CTA_TIMEOUT_UDPLITE_REPLIED, - htonl(timeouts[UDPLITE_CT_REPLIED] / HZ)); + if (nla_put_be32(skb, CTA_TIMEOUT_UDPLITE_UNREPLIED, + htonl(timeouts[UDPLITE_CT_UNREPLIED] / HZ)) || + nla_put_be32(skb, CTA_TIMEOUT_UDPLITE_REPLIED, + htonl(timeouts[UDPLITE_CT_REPLIED] / HZ))) + goto nla_put_failure; return 0; nla_put_failure: |