summaryrefslogtreecommitdiff
path: root/ovn
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2015-07-28 11:25:59 -0700
committerBen Pfaff <blp@nicira.com>2015-07-28 12:41:42 -0700
commitadc48a5d252c28bd568bc1d13f0c2a4784f5a5e9 (patch)
tree865efdb5b6c9130ec6b99eed6ae077435f793dc8 /ovn
parent34f3e8406b005bf4ed9029e98b68eb53f366d0f1 (diff)
downloadopenvswitch-adc48a5d252c28bd568bc1d13f0c2a4784f5a5e9.tar.gz
ofctrl: Fix use of uninitialized hash value in ofctrl_add_flow().
When ofctrl_add_flow() called ovn_flow_lookup(), the latter used the hash from the flow's hmap_node, but the former hadn't initialized it at that point. This commit fixes the problem. Reported-by: Russell Bryant <rbryant@redhat.com> Reported-at: http://openvswitch.org/pipermail/dev/2015-July/057851.html Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Russell Bryant <rbryant@redhat.com>
Diffstat (limited to 'ovn')
-rw-r--r--ovn/controller/ofctrl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ovn/controller/ofctrl.c b/ovn/controller/ofctrl.c
index c5486457f..e701f8bae 100644
--- a/ovn/controller/ofctrl.c
+++ b/ovn/controller/ofctrl.c
@@ -268,6 +268,7 @@ ofctrl_add_flow(struct hmap *desired_flows,
f->match = *match;
f->ofpacts = xmemdup(actions->data, actions->size);
f->ofpacts_len = actions->size;
+ f->hmap_node.hash = ovn_flow_hash(f);
if (ovn_flow_lookup(desired_flows, f)) {
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 5);
@@ -281,7 +282,7 @@ ofctrl_add_flow(struct hmap *desired_flows,
return;
}
- hmap_insert(desired_flows, &f->hmap_node, ovn_flow_hash(f));
+ hmap_insert(desired_flows, &f->hmap_node, f->hmap_node.hash);
}
/* ovn_flow. */