]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - net/openvswitch/datapath.c
openvswitch: fix flow command message size
[mirror_ubuntu-bionic-kernel.git] / net / openvswitch / datapath.c
index 27dc1d5b0c28f589e557f9c54c6c216bd97b4854..5eb352eb8db859e235d24d866ccf219912208e8d 100644 (file)
@@ -697,9 +697,13 @@ static size_t ovs_flow_cmd_msg_size(const struct sw_flow_actions *acts,
 {
        size_t len = NLMSG_ALIGN(sizeof(struct ovs_header));
 
-       /* OVS_FLOW_ATTR_UFID */
+       /* OVS_FLOW_ATTR_UFID, or unmasked flow key as fallback
+        * see ovs_nla_put_identifier()
+        */
        if (sfid && ovs_identifier_is_ufid(sfid))
                len += nla_total_size(sfid->ufid_len);
+       else
+               len += nla_total_size(ovs_key_attr_size());
 
        /* OVS_FLOW_ATTR_KEY */
        if (!sfid || should_fill_key(sfid, ufid_flags))