summaryrefslogtreecommitdiff
path: root/ofproto
diff options
context:
space:
mode:
authorJoe Stringer <joe@ovn.org>2016-05-10 15:42:01 -0700
committerJoe Stringer <joe@ovn.org>2016-05-11 16:45:46 -0700
commitaf50de800ecbe86d25b123971606e31653605108 (patch)
tree46e25a3e8f6cea8185d333972a9222198cafa5c8 /ofproto
parentb351ac0c9bc270b3fff07ae8c7434c53d59b132c (diff)
downloadopenvswitch-af50de800ecbe86d25b123971606e31653605108.tar.gz
ofproto-dpif-upcall: Pass key to dpif_flow_get().
Windows datapath folks have reported instances where OVS userspace will pass down a flow_get request to the datapath using a UFID even though the datapath has no support for UFIDs. Since commit e672ff9b4d22 ("ofproto-dpif: Restore metadata and registers on recirculation."), if a flow dump provides a flow that userspace isn't aware of, and the flow dump doesn't provide actions for that flow, then userspace will attempt a flow_get using just the UFID. This is because the ofproto-dpif layer doesn't pass the key down to the dpif layer even if it's available. Prior to the above commit, the codepath was only hit if the key was not available, which would have implied UFID support. This assumption is now broken: An empty set of actions could also trigger flow_get, and datapaths without UFID support are free to pass up empty actions lists. Pass down the flow key if available, and don't pass down the UFID if unavailable to be more consistent with the usage of other dpif APIs within this file. Fixes: e672ff9b4d22 ("ofproto-dpif: Restore metadata and registers on recirculation.") Reported-by: Sairam Venugopal <vsairam@vmware.com> Signed-off-by: Joe Stringer <joe@ovn.org> Acked-by: Jarno Rajahalme <jarno@ovn.org>
Diffstat (limited to 'ofproto')
-rw-r--r--ofproto/ofproto-dpif-upcall.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index ae8c2d366..0543c78e8 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -1518,7 +1518,8 @@ ukey_create_from_dpif_flow(const struct udpif *udpif,
/* If the key or actions were not provided by the datapath, fetch the
* full flow. */
ofpbuf_use_stack(&buf, &stub, sizeof stub);
- err = dpif_flow_get(udpif->dpif, NULL, 0, &flow->ufid,
+ err = dpif_flow_get(udpif->dpif, flow->key, flow->key_len,
+ flow->ufid_present ? &flow->ufid : NULL,
flow->pmd_id, &buf, &full_flow);
if (err) {
return err;