mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
openvswitch: fix flow command message size
[ Upstream commit 4e81c0b3fa93d07653e2415fa71656b080a112fd ]
When user-space sets the OVS_UFID_F_OMIT_* flags, and the relevant
flow has no UFID, we can exceed the computed size, as
ovs_nla_put_identifier() will always dump an OVS_FLOW_ATTR_KEY
attribute.
Take the above in account when computing the flow command message
size.
Fixes: 74ed7ab926 ("openvswitch: Add support for unique flow IDs.")
Reported-by: Qi Jun Ding <[email protected]>
Signed-off-by: Paolo Abeni <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
dbb5cc35b9
commit
8109f5b67a
1 changed files with 5 additions and 1 deletions
|
|
@ -704,9 +704,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))
|
||||
|
|
|
|||
Loading…
Reference in a new issue