]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - net/openvswitch/datapath.c
UBUNTU: Ubuntu-raspi2-4.13.0-1014.15
[mirror_ubuntu-artful-kernel.git] / net / openvswitch / datapath.c
index 45fe8c8a884df36100bc0cf26d279cb92e51bdf8..294444bb075c8b88dd3807a0a659be17a43863c4 100644 (file)
@@ -381,7 +381,7 @@ static int queue_gso_packets(struct datapath *dp, struct sk_buff *skb,
 }
 
 static size_t upcall_msg_size(const struct dp_upcall_info *upcall_info,
-                             unsigned int hdrlen)
+                             unsigned int hdrlen, int actions_attrlen)
 {
        size_t size = NLMSG_ALIGN(sizeof(struct ovs_header))
                + nla_total_size(hdrlen) /* OVS_PACKET_ATTR_PACKET */
@@ -398,7 +398,7 @@ static size_t upcall_msg_size(const struct dp_upcall_info *upcall_info,
 
        /* OVS_PACKET_ATTR_ACTIONS */
        if (upcall_info->actions_len)
-               size += nla_total_size(upcall_info->actions_len);
+               size += nla_total_size(actions_attrlen);
 
        /* OVS_PACKET_ATTR_MRU */
        if (upcall_info->mru)
@@ -465,7 +465,8 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
        else
                hlen = skb->len;
 
-       len = upcall_msg_size(upcall_info, hlen - cutlen);
+       len = upcall_msg_size(upcall_info, hlen - cutlen,
+                             OVS_CB(skb)->acts_origlen);
        user_skb = genlmsg_new(len, GFP_ATOMIC);
        if (!user_skb) {
                err = -ENOMEM;
@@ -1125,7 +1126,8 @@ static int ovs_nla_init_match_and_action(struct net *net,
                if (!a[OVS_FLOW_ATTR_KEY]) {
                        OVS_NLERR(log,
                                  "Flow key attribute not present in set flow.");
-                       return -EINVAL;
+                       error = -EINVAL;
+                       goto error;
                }
 
                *acts = get_flow_actions(net, a[OVS_FLOW_ATTR_ACTIONS], key,