diff options
author | HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp> | 2012-10-11 16:25:03 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2012-10-12 02:28:32 +0900 |
commit | c42673def1c1c6b66e8179fc861d2f1e0a868668 (patch) | |
tree | 3d8fe4dd1e44160a7b938fa99bd1ba9ea7b70370 | |
parent | 398d9a4ba326022ecd0b132b663fb36f6f2beab8 (diff) |
packet lib: fix ipv4 assertion of option field
Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/lib/packet/ipv4.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ryu/lib/packet/ipv4.py b/ryu/lib/packet/ipv4.py index d3cc4b3e..99140d4f 100644 --- a/ryu/lib/packet/ipv4.py +++ b/ryu/lib/packet/ipv4.py @@ -73,7 +73,7 @@ class ipv4(packet_base.PacketBase): self.ttl, self.proto, 0, self.src, self.dst) if self.option: - assert struct.calcsize('I') >= len(self.option) + assert (self.length - ipv4._MIN_LEN) >= len(self.option) hdr[ipv4._MIN_LEN:ipv4._MIN_LEN + len(self.option)] = self.option self.csum = socket.htons(packet_utils.checksum(hdr)) |