summaryrefslogtreecommitdiff
path: root/net/openvswitch/conntrack.c
diff options
context:
space:
mode:
authorHaishuang Yan <yanhaishuang@cmss.chinamobile.com>2016-03-28 13:08:59 +0300
committerDavid S. Miller <davem@davemloft.net>2016-03-28 18:37:14 +0300
commitac71b46efd2838c02ec193987c8f61c3ba33b495 (patch)
treee7deb5ade34f3415b907a4cc633305361af66070 /net/openvswitch/conntrack.c
parentd7be81a5916bdb1d904803958e5991a16f7ae4b2 (diff)
downloadlinux-ac71b46efd2838c02ec193987c8f61c3ba33b495.tar.xz
openvswitch: Use proper buffer size in nla_memcpy
For the input parameter count, it's better to use the size of destination buffer size, as nla_memcpy would take into account the length of the source netlink attribute when a data is copied from an attribute. Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/openvswitch/conntrack.c')
-rw-r--r--net/openvswitch/conntrack.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c
index dc5eb29fe7d6..f8a8d4390a8a 100644
--- a/net/openvswitch/conntrack.c
+++ b/net/openvswitch/conntrack.c
@@ -968,7 +968,8 @@ static int parse_nat(const struct nlattr *attr,
break;
case OVS_NAT_ATTR_IP_MIN:
- nla_memcpy(&info->range.min_addr, a, nla_len(a));
+ nla_memcpy(&info->range.min_addr, a,
+ sizeof(info->range.min_addr));
info->range.flags |= NF_NAT_RANGE_MAP_IPS;
break;