diff options
Diffstat (limited to 'net/openvswitch/datapath.c')
-rw-r--r-- | net/openvswitch/datapath.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index f9d2438e6437..96cd5b243d57 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c | |||
@@ -370,8 +370,8 @@ static int queue_userspace_packet(struct net *net, int dp_ifindex, | |||
370 | len = sizeof(struct ovs_header); | 370 | len = sizeof(struct ovs_header); |
371 | len += nla_total_size(skb->len); | 371 | len += nla_total_size(skb->len); |
372 | len += nla_total_size(FLOW_BUFSIZE); | 372 | len += nla_total_size(FLOW_BUFSIZE); |
373 | if (upcall_info->cmd == OVS_PACKET_CMD_ACTION) | 373 | if (upcall_info->userdata) |
374 | len += nla_total_size(8); | 374 | len += NLA_ALIGN(upcall_info->userdata->nla_len); |
375 | 375 | ||
376 | user_skb = genlmsg_new(len, GFP_ATOMIC); | 376 | user_skb = genlmsg_new(len, GFP_ATOMIC); |
377 | if (!user_skb) { | 377 | if (!user_skb) { |
@@ -388,8 +388,9 @@ static int queue_userspace_packet(struct net *net, int dp_ifindex, | |||
388 | nla_nest_end(user_skb, nla); | 388 | nla_nest_end(user_skb, nla); |
389 | 389 | ||
390 | if (upcall_info->userdata) | 390 | if (upcall_info->userdata) |
391 | nla_put_u64(user_skb, OVS_PACKET_ATTR_USERDATA, | 391 | __nla_put(user_skb, OVS_PACKET_ATTR_USERDATA, |
392 | nla_get_u64(upcall_info->userdata)); | 392 | nla_len(upcall_info->userdata), |
393 | nla_data(upcall_info->userdata)); | ||
393 | 394 | ||
394 | nla = __nla_reserve(user_skb, OVS_PACKET_ATTR_PACKET, skb->len); | 395 | nla = __nla_reserve(user_skb, OVS_PACKET_ATTR_PACKET, skb->len); |
395 | 396 | ||
@@ -544,7 +545,7 @@ static int validate_userspace(const struct nlattr *attr) | |||
544 | { | 545 | { |
545 | static const struct nla_policy userspace_policy[OVS_USERSPACE_ATTR_MAX + 1] = { | 546 | static const struct nla_policy userspace_policy[OVS_USERSPACE_ATTR_MAX + 1] = { |
546 | [OVS_USERSPACE_ATTR_PID] = {.type = NLA_U32 }, | 547 | [OVS_USERSPACE_ATTR_PID] = {.type = NLA_U32 }, |
547 | [OVS_USERSPACE_ATTR_USERDATA] = {.type = NLA_U64 }, | 548 | [OVS_USERSPACE_ATTR_USERDATA] = {.type = NLA_UNSPEC }, |
548 | }; | 549 | }; |
549 | struct nlattr *a[OVS_USERSPACE_ATTR_MAX + 1]; | 550 | struct nlattr *a[OVS_USERSPACE_ATTR_MAX + 1]; |
550 | int error; | 551 | int error; |