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


Oops. Yes, it can be that entry_size < entry.length. So the changed logic
looks good.
Now the argument, entry_size, is unused, it should be dropped.

thanks

> -- 
> 1.7.4.4
> 
> 
> ------------------------------------------------------------------------------
> 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
> 

-- 
yamahata

------------------------------------------------------------------------------
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