On Tue, Jul 24, 2012 at 01:31:41PM -0700, Ben Pfaff wrote: > On Mon, Jul 23, 2012 at 03:16:35PM +0900, Simon Horman wrote: > > Signed-off-by: Simon Horman <ho...@verge.net.au> > > struct ofpbuf * > > -ofputil_encode_barrier_request(void) > > +ofputil_encode_barrier_request(uint8_t ofp_version) > > { > > - return ofpraw_alloc(OFPRAW_OFPT10_BARRIER_REQUEST, OFP10_VERSION, 0); > > + enum ofpraw type; > > + > > + switch (ofp_version) { > > + case OFP12_VERSION: > > + case OFP11_VERSION: > > + type = OFPRAW_OFPT11_BARRIER_REQUEST; > > + break; > > + > > + case OFP10_VERSION: > > + type = OFPRAW_OFPT10_BARRIER_REQUEST; > > + break; > > + > > + default: > > + NOT_REACHED(); > > + } > > + > > + return ofpraw_alloc(type, ofp_version, 0); > > } > > This will need to change when we add new OpenFlow versions, but I > don't expect that new OpenFlow versions will actually change anything > in the barrier request. So I'd be inclined to do something like: > raw = (version == OFP10_VERSION > ? OFPRAW_OFPT10_BARRIER_REQUEST > : OFPRAW_OFPT11_BARRIER_REQUEST); > instead of a switch that definitely needs to be updated.
I do have a slight preference for the case style, but I'll change update your patch as per your suggestion. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev