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

Ben Pfaff blp at nicira.com
Fri May 20 23:44:02 UTC 2011


I pushed the patch.

You can tell that both "cookie" members are in network byte order by
looking at the types: both are declared as type ovs_be64 (the "be"
stands for "big-endian").

On Fri, May 20, 2011 at 04:41:21PM -0700, kk yap wrote:
> Hi Ben,
> 
> The patch works!  Thanks.
> 
> One strange thing is the lack of htonll.  It would seems like fr is in
> host order and ofr is in network order, so the function is needed.
> However, adding the function gives the wrong result.  FYI.
> 
> Regards
> KK
> 
> On 20 May 2011 16:08, Ben Pfaff <blp at nicira.com> wrote:
> > 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