summaryrefslogtreecommitdiffstats
path: root/net/openvswitch/datapath.c
diff options
context:
space:
mode:
authorThomas Graf2013-03-29 14:46:48 +0100
committerJesse Gross2013-03-30 01:53:46 +0100
commit32686a9d2988516788cfcc402e1355c1eba1186a (patch)
tree1dddb07c73f7e8ece015c414ea517b51eddfa182 /net/openvswitch/datapath.c
parentopenvswitch: Specify the minimal length of OVS_PACKET_ATTR_PACKET in the policy (diff)
downloadkernel-qcow2-linux-32686a9d2988516788cfcc402e1355c1eba1186a.tar.gz
kernel-qcow2-linux-32686a9d2988516788cfcc402e1355c1eba1186a.tar.xz
kernel-qcow2-linux-32686a9d2988516788cfcc402e1355c1eba1186a.zip
openvswitch: Use nla_memcpy() to memcpy() data from attributes
Less error prone as it takes into account the length of both the destination buffer and the source attribute and documents when data is copied from an attribute. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Jesse Gross <jesse@nicira.com>
Diffstat (limited to 'net/openvswitch/datapath.c')
-rw-r--r--net/openvswitch/datapath.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index 5b58d163a4dc..bca63c8487bb 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -672,7 +672,7 @@ static int ovs_packet_cmd_execute(struct sk_buff *skb, struct genl_info *info)
goto err;
skb_reserve(packet, NET_IP_ALIGN);
- memcpy(__skb_put(packet, len), nla_data(a[OVS_PACKET_ATTR_PACKET]), len);
+ nla_memcpy(__skb_put(packet, len), a[OVS_PACKET_ATTR_PACKET], len);
skb_reset_mac_header(packet);
eth = eth_hdr(packet);