diff options
-rw-r--r-- | ryu/lib/packet/bgp.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ryu/lib/packet/bgp.py b/ryu/lib/packet/bgp.py index cad43806..1038b5e3 100644 --- a/ryu/lib/packet/bgp.py +++ b/ryu/lib/packet/bgp.py @@ -1270,7 +1270,7 @@ class BGPOptParamCapabilityGracefulRestart(_OptParamCapability): (restart, ) = struct.unpack_from(cls._CAP_PACK_STR, six.binary_type(buf)) buf = buf[2:] l = [] - while len(buf) > 0: + while len(buf) >= 4: l.append(struct.unpack_from("!HBB", buf)) buf = buf[4:] return {'flags': restart >> 12, 'time': restart & 0xfff, 'tuples': l} |