From 4404d8c67a59aceef0e1be758a8dda703f2cf296 Mon Sep 17 00:00:00 2001
From: Phil <phil@secdev.org>
Date: Fri, 19 Dec 2008 16:33:12 +0100
Subject: [PATCH] Forced 32bits value in utils.ltoa() (ticket #145)

---
 scapy/utils.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scapy/utils.py b/scapy/utils.py
index 89148eff..6c10cc13 100644
--- a/scapy/utils.py
+++ b/scapy/utils.py
@@ -270,7 +270,7 @@ def atol(x):
         ip = inet_aton(socket.gethostbyname(x))
     return struct.unpack("!I", ip)[0]
 def ltoa(x):
-    return inet_ntoa(struct.pack("!I", x))
+    return inet_ntoa(struct.pack("!I", x&0xffffffff))
 
 def itom(x):
     return (0xffffffff00000000L>>x)&0xffffffffL
-- 
GitLab