Skip to content

Commit e9164fc

Browse files
committed
Work on 64-bit systems
1 parent 63889a7 commit e9164fc

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

NetworkManager.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ def addrconf_to_dbus(addrconf):
342342
addr, netmask, gateway = addrconf
343343
return [
344344
fixups.addr_to_dbus(addr),
345-
netmask,
345+
fixups.mask_to_dbus(netmask),
346346
fixups.addr_to_dbus(gateway)
347347
]
348348

@@ -352,7 +352,11 @@ def addr_to_python(addr):
352352

353353
@staticmethod
354354
def addr_to_dbus(addr):
355-
return struct.unpack('I', socket.inet_aton(addr))
355+
return dbus.UInt32(struct.unpack('I', socket.inet_aton(addr))[0])
356+
357+
@staticmethod
358+
def mask_to_dbus(mask):
359+
return dbus.UInt32(mask)
356360

357361
@staticmethod
358362
def route_to_python(route):
@@ -369,7 +373,7 @@ def route_to_dbus(route):
369373
addr, netmask, gateway, metric = route
370374
return [
371375
fixups.addr_to_dbus(addr),
372-
netmask,
376+
fixups.mask_to_dbus(netmask),
373377
fixups.addr_to_dbus(gateway),
374378
socket.htonl(metric)
375379
]

0 commit comments

Comments
 (0)