提交 ac71b46e 编写于 作者: H Haishuang Yan 提交者: David S. Miller

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: NHaishuang Yan <yanhaishuang@cmss.chinamobile.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 d7be81a5
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册