On Mon, Jan 08, 2018 at 03:23:26PM -0800, Justin Pettit wrote:
>
> > On Jan 6, 2018, at 10:33 AM, Ben Pfaff <[email protected]> wrote:
> >
> > /* Creates and returns an OpenFlow message of type OFPT_ERROR that conveys
> > the
> > diff --git a/ofproto/bundles.c b/ofproto/bundles.c
> > index 849f99a15e40..195b9f90ef11 100644
> > --- a/ofproto/bundles.c
> > +++ b/ofproto/bundles.c
> > @@ -51,13 +51,10 @@ ofp_bundle_create(uint32_t id, uint16_t flags, const
> > struct ofp_header *oh)
> > bundle->id = id;
> > bundle->flags = flags;
> > bundle->state = BS_OPEN;
> > + bundle->msg = xmemdup(oh, ntohs(oh->length));
> >
> > ovs_list_init(&bundle->msg_list);
> >
> > return bundle;
> > }
> >
> > @@ -71,6 +68,7 @@ ofp_bundle_remove__(struct ofconn *ofconn, struct
> > ofp_bundle *bundle)
> > }
> >
> > ofconn_remove_bundle(ofconn, bundle);
> > + free(bundle->msg);
> > free(bundle);
> > }
>
> There are two other places that free 'bundle' directly in the file, so
> you may want to handle those as well.
Thanks for pointing that out.
When I looked closer, both of those cases were dead code, because they
handled error returns from functions that always succeeded. I changed
the functions that they called so that they return void instead of an
error value and then deleted the error handling code.
> > diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c
> > index 7f33fbddfe3f..ae53bfb04a83 100644
> > --- a/ofproto/connmgr.c
> > +++ b/ofproto/connmgr.c
> > @@ -1256,7 +1256,7 @@ bundle_remove_expired(struct ofconn *ofconn, long
> > long int now)
> >
> > HMAP_FOR_EACH_SAFE (b, next, node, &ofconn->bundles) {
> > if (b->used <= limit) {
> > - ofconn_send_error(ofconn, &b->ofp_msg, OFPERR_OFPBFC_TIMEOUT);
> > + ofconn_send_error(ofconn, b->msg, OFPERR_OFPBFC_TIMEOUT);
>
> The comment for ofconn_send_error() should be updated to indicate it's not
> limited to 64 bytes anymore.
Thanks, done.
> Acked-by: Justin Pettit <[email protected]>
>
> This seems like it will be helpful. Thanks!
Thanks! I applied this to master.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev