aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugeni Dodonov <eugeni@mandriva.com>2010-06-05 18:34:50 -0300
committerEugeni Dodonov <eugeni@mandriva.com>2010-06-05 18:35:19 -0300
commit8da08c70d3376ed441045941365808f870e3dcb2 (patch)
tree932d79808da272d47207b3f1e2ea1aa48c7a0e20
parent73e53f9e5f2256a010dc979eae68ce4aea08587e (diff)
downloadnet_monitor-8da08c70d3376ed441045941365808f870e3dcb2.tar
net_monitor-8da08c70d3376ed441045941365808f870e3dcb2.tar.gz
net_monitor-8da08c70d3376ed441045941365808f870e3dcb2.tar.bz2
net_monitor-8da08c70d3376ed441045941365808f870e3dcb2.tar.xz
net_monitor-8da08c70d3376ed441045941365808f870e3dcb2.zip
use unsigned ints for ip addresses
-rw-r--r--src/monitor.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/monitor.py b/src/monitor.py
index 893cd10..40df58a 100644
--- a/src/monitor.py
+++ b/src/monitor.py
@@ -268,7 +268,7 @@ class Monitor:
iface = params[0]
dst = int(params[1], 16)
gw = int(params[2], 16)
- gw_str = socket.inet_ntoa(struct.pack("i", gw))
+ gw_str = socket.inet_ntoa(struct.pack("I", gw))
metric = int(params[6], 16)
mask = int(params[7], 16)
routes.append((iface, dst, mask, gw, metric))
@@ -302,9 +302,9 @@ class Monitor:
status=fields[3]
loc_a,loc_p = loc.split(":")
rem_a,rem_p = rem.split(":")
- loc_addr = socket.inet_ntoa(struct.pack('i', int(loc_a, 16)))
+ loc_addr = socket.inet_ntoa(struct.pack('I', int(loc_a, 16)))
loc_port = (int(loc_p, 16))
- rem_addr = socket.inet_ntoa(struct.pack('i', int(rem_a, 16)))
+ rem_addr = socket.inet_ntoa(struct.pack('I', int(rem_a, 16)))
rem_port = (int(rem_p, 16))
# parse status
status = int(status, 16)