[ovs-discuss] Bug Report: Cookie returned is always zero

Ben Pfaff blp at nicira.com
Fri May 20 23:08:00 UTC 2011


On Fri, May 20, 2011 at 04:03:49PM -0700, kk yap wrote:
> We are sending flow_mod with some cookie value (e.g., deadbeef), but
> all the flow_removed returns with cookie 0.  A sample tcpdump of the
> OpenFlow control traffic is attached.

I like bugs that are easy to track down.  Please try this patch:

--8<--------------------------cut here-------------------------->8--

From: Ben Pfaff <blp at nicira.com>
Date: Fri, 20 May 2011 16:07:12 -0700
Subject: [PATCH] ofp-util: Include cookie when encoding OFPT_FLOW_REMOVED
 messages.

Reported-by: kk yap <yapkke at stanford.edu>
---
 lib/ofp-util.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index 5004063..b376d14 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -1378,6 +1378,7 @@ ofputil_encode_flow_removed(const struct ofputil_flow_removed *fr,
         ofr = make_openflow_xid(sizeof *ofr, OFPT_FLOW_REMOVED, htonl(0),
                                 &msg);
         ofputil_cls_rule_to_match(&fr->rule, &ofr->match);
+        ofr->cookie = fr->cookie;
         ofr->priority = htons(fr->rule.priority);
         ofr->reason = fr->reason;
         ofr->duration_sec = htonl(fr->duration_sec);
-- 
1.7.4.4




More information about the discuss mailing list