On Thu, May 10, 2012 at 02:50:30PM +0900, FUJITA Tomonori wrote:
> On Thu, 10 May 2012 09:55:45 +0900
> Simon Horman <[email protected]> wrote:
> 
> > On Thu, May 10, 2012 at 06:39:49AM +0900, FUJITA Tomonori wrote:
> > > ryu crashes when it gets OFPT_STATS_REPLY including OFP actions.
> > > 
> > > ofp_flow_stats can include ofp_action_header(s) so
> > > parser_stats_body_array method can't use the entry_size argument (the
> > > minimum size, 88 bytes). It needs to use the size that body_cls's
> > > parser returns.
> > > 
> > > Signed-off-by: FUJITA Tomonori <[email protected]>
> > > ---
> > >  ryu/ofproto/ofproto_v1_0_parser.py |    4 ++--
> > >  1 files changed, 2 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/ryu/ofproto/ofproto_v1_0_parser.py 
> > > b/ryu/ofproto/ofproto_v1_0_parser.py
> > > index ea164bd..4b9b63d 100644
> > > --- a/ryu/ofproto/ofproto_v1_0_parser.py
> > > +++ b/ryu/ofproto/ofproto_v1_0_parser.py
> > > @@ -1117,10 +1117,10 @@ class OFPStatsReply(MsgBase):
> > >      def parser_stats_body_array(cls, buf, msg_len, offset, entry_size):
> > >          body_cls = cls.cls_stats_body_cls
> > >          body = []
> > > -        while offset + entry_size <= msg_len:
> > > +        while offset < msg_len:
> > >              entry = body_cls.parser(buf, offset)
> > >              body.append(entry)
> > > -            offset += entry_size
> > > +            offset += entry.length
> > >          return body
> > >  
> > >      @classmethod
> > 
> > Hi Fujita-san,
> > 
> > are you concerned about differentiating between replies types that are 
> > arrays
> > and those that may only contain a single element?
> 
> Yeah, I thought that the code is a bit hacky. I'll see how I can clean
> up the code later.

That sounds reasonable to me.

My understanding from discussing implementing OXM with Ben Pfaff is that
Open vSwtich tends to have a fairly liberal parser in order to simplify the
code. I think that for now that is a reasonable approach here too.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to