On Tue, Jun 26, 2012 at 04:00:00PM -0700, Pravin Shelar wrote:
> On Mon, Jun 11, 2012 at 11:26 AM, Ben Pfaff <[email protected]> wrote:
> > dump_stats_transaction() ignored errors and other non-stats replies to
> > its request and would continue to wait forever.  This fixes the problem.
> >
> > Signed-off-by: Ben Pfaff <[email protected]>
> > ---
> >  utilities/ovs-ofctl.c |   17 ++++++++++++++---
> >  1 files changed, 14 insertions(+), 3 deletions(-)
> >
> > diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
> > index 8f02192..8f5a3f0 100644
> > --- a/utilities/ovs-ofctl.c
> > +++ b/utilities/ovs-ofctl.c
> > @@ -392,12 +392,23 @@ dump_stats_transaction(const char *vconn_name, struct 
> > ofpbuf *request)
> >         run(vconn_recv_block(vconn, &reply), "OpenFlow packet receive 
> > failed");
> >         recv_xid = ((struct ofp_header *) reply->data)->xid;
> >         if (send_xid == recv_xid) {
> > -            struct ofp_stats_msg *osm;
> > +            const struct ofputil_msg_type *type;
> > +            enum ofputil_msg_code code;
> >
> >             ofp_print(stdout, reply->data, reply->size, verbosity + 1);
> >
> > -            osm = ofpbuf_at(reply, 0, sizeof *osm);
> > -            done = !osm || !(ntohs(osm->flags) & OFPSF_REPLY_MORE);
> > +            ofputil_decode_msg_type(reply->data, &type);
> > +            code = ofputil_msg_type_code(type);
> > +            if (code == OFPUTIL_OFPST_QUEUE_REPLY) {
> > +                struct ofp_stats_msg *osm = reply->data;
> > +                done = !(ntohs(osm->flags) & OFPSF_REPLY_MORE);
> There can be different type of reply depending on request, so this
> condition check does not work.
> may be  dump_stats_transaction caller can specify reply type?

Oh, that was a dumb mistake.

Instead of making the caller specify the reply type, we can figure it
out from the request.

I'll send out a new version of the series in a few minutes.
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to