[ovs-dev] [bug 10184 1/5] learn: Initialize cookie_mask in constructed flow_mod.

Ben Pfaff blp at nicira.com
Tue Mar 20 22:44:15 UTC 2012


Otherwise the "learn" action may not correctly set the cookie in flows that
it creates.

Found by valgrind.

Signed-off-by: Ben Pfaff <blp at nicira.com>
---
 lib/learn.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lib/learn.c b/lib/learn.c
index 9ca8b65..94fc1b0 100644
--- a/lib/learn.c
+++ b/lib/learn.c
@@ -197,6 +197,7 @@ learn_execute(const struct nx_action_learn *learn, const struct flow *flow,
 
     cls_rule_init_catchall(&fm->cr, ntohs(learn->priority));
     fm->cookie = learn->cookie;
+    fm->cookie_mask = htonll(UINT64_MAX);
     fm->table_id = learn->table_id;
     fm->command = OFPFC_MODIFY_STRICT;
     fm->idle_timeout = ntohs(learn->idle_timeout);
-- 
1.7.2.5




More information about the dev mailing list