Re: [Ryu-devel] [PATCH] packet/icmpv6: Fix parsing undefined nd_option fails

2017-08-04 Thread FUJITA Tomonori
On Wed, 2 Aug 2017 11:18:49 +0900 Satoshi Fujimoto wrote: > The length of nd_option is units of 8 octets. > Currently, for nd_options which is undefined in the ICMPv6 packet library, > the parser assumes that the length is [8 * length - 2]. > It causes fails while

Re: [Ryu-devel] [PATCH] packet/icmpv6: Fix parsing undefined nd_option fails

2017-08-01 Thread Shivaram Mysore
Thank you Fujimoto-san /Shivaram ::Sent from my mobile device:: > On Aug 1, 2017, at 9:39 PM, Fujimoto Satoshi > wrote: > > Hi, Shivaram > > Oops, I overlooked about it. > > It is needed for not only avoiding infinite loop, but also complying RFC. > For the

Re: [Ryu-devel] [PATCH] packet/icmpv6: Fix parsing undefined nd_option fails

2017-08-01 Thread Fujimoto Satoshi
Hi, Shivaram Oops, I overlooked about it. It is needed for not only avoiding infinite loop, but also complying RFC. For the 'length' field in options, RFC4861 says that: The value 0 is invalid. Nodes MUST silently discard an ND packet that contains an option with length zero. So

Re: [Ryu-devel] [PATCH] packet/icmpv6: Fix parsing undefined nd_option fails

2017-08-01 Thread Shivaram Mysore
Hello, The patch from Bill was suggesting something like this: if cls_ is not None: option = cls_.parser(buf, offset) else: -option = buf[offset:offset + (length * 8 - 2)] +assert length > 0 # avoid infinite loop when

[Ryu-devel] [PATCH] packet/icmpv6: Fix parsing undefined nd_option fails

2017-08-01 Thread Satoshi Fujimoto
The length of nd_option is units of 8 octets. Currently, for nd_options which is undefined in the ICMPv6 packet library, the parser assumes that the length is [8 * length - 2]. It causes fails while parsing these options. This patch fixes it to parse such options correctly. Signed-off-by: