summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSatoshi Fujimoto <satoshi.fujimoto7@gmail.com>2017-08-02 11:18:49 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-08-04 21:11:09 +0900
commitee9a197dd6e7fd00858dbf50ba804c41d29e3625 (patch)
tree260105679b93a594c909fa08a895fccf7ad27944
parent44cd14ac81382cb8ce0fcc91ad377f2dc99d4fb8 (diff)
packet/icmpv6: Fix parsing undefined nd_option fails
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. Reported-by: William Fisher <william.w.fisher@gmail.com> Reported-by: Shivaram Mysore <shivaram.mysore@gmail.com> Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/lib/packet/icmpv6.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ryu/lib/packet/icmpv6.py b/ryu/lib/packet/icmpv6.py
index 1e5eaea8..7608169b 100644
--- a/ryu/lib/packet/icmpv6.py
+++ b/ryu/lib/packet/icmpv6.py
@@ -363,7 +363,7 @@ class nd_router_advert(stringify.StringifyMixin):
if cls_ is not None:
option = cls_.parser(buf, offset)
else:
- option = buf[offset:offset + (length * 8 - 2)]
+ option = buf[offset:offset + (length * 8)]
options.append(option)
offset += len(option)
msg = cls(ch_l, res >> 6, rou_l, rea_t, ret_t, options)