diff options
author | David S. Miller <davem@davemloft.net> | 2012-04-01 18:58:28 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-01 18:58:28 -0400 |
commit | bae65be896cc420f58460cb6f6ac03e71d1bf240 (patch) | |
tree | ad3ae20c94195786415e5fb7b2cecd98c5f6be3e | |
parent | cc1eb43134c07435955263dfe5d2fc980fe8b808 (diff) |
nf_conntrack_core: 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>
-rw-r--r-- | net/netfilter/nf_conntrack_core.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index cbdb754dbb10..b0ab8c43abe7 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c | |||
@@ -1151,8 +1151,9 @@ static struct nf_ct_ext_type nf_ct_zone_extend __read_mostly = { | |||
1151 | int nf_ct_port_tuple_to_nlattr(struct sk_buff *skb, | 1151 | int nf_ct_port_tuple_to_nlattr(struct sk_buff *skb, |
1152 | const struct nf_conntrack_tuple *tuple) | 1152 | const struct nf_conntrack_tuple *tuple) |
1153 | { | 1153 | { |
1154 | NLA_PUT_BE16(skb, CTA_PROTO_SRC_PORT, tuple->src.u.tcp.port); | 1154 | if (nla_put_be16(skb, CTA_PROTO_SRC_PORT, tuple->src.u.tcp.port) || |
1155 | NLA_PUT_BE16(skb, CTA_PROTO_DST_PORT, tuple->dst.u.tcp.port); | 1155 | nla_put_be16(skb, CTA_PROTO_DST_PORT, tuple->dst.u.tcp.port)) |
1156 | goto nla_put_failure; | ||
1156 | return 0; | 1157 | return 0; |
1157 | 1158 | ||
1158 | nla_put_failure: | 1159 | nla_put_failure: |