Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[deliverable/linux.git] / net / netfilter / nf_conntrack_core.c
index 729f157a0efa690cf877dbd9dbb94dd1b09f1be6..cf0747c5741f8b687d8d8b8572cf8462fc488e34 100644 (file)
@@ -1152,8 +1152,9 @@ static struct nf_ct_ext_type nf_ct_zone_extend __read_mostly = {
 int nf_ct_port_tuple_to_nlattr(struct sk_buff *skb,
                               const struct nf_conntrack_tuple *tuple)
 {
-       NLA_PUT_BE16(skb, CTA_PROTO_SRC_PORT, tuple->src.u.tcp.port);
-       NLA_PUT_BE16(skb, CTA_PROTO_DST_PORT, tuple->dst.u.tcp.port);
+       if (nla_put_be16(skb, CTA_PROTO_SRC_PORT, tuple->src.u.tcp.port) ||
+           nla_put_be16(skb, CTA_PROTO_DST_PORT, tuple->dst.u.tcp.port))
+               goto nla_put_failure;
        return 0;
 
 nla_put_failure:
This page took 0.027339 seconds and 5 git commands to generate.