Signed-off-by: HIYAMA Manabu <[email protected]>
---
 ryu/lib/packet/ipv4.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ryu/lib/packet/ipv4.py b/ryu/lib/packet/ipv4.py
index d3cc4b3..99140d4 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))
-- 
1.7.9.5



------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to