diff options
-rw-r--r-- | src/monitor.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/monitor.py b/src/monitor.py index 87bf2b5..78d6b4b 100644 --- a/src/monitor.py +++ b/src/monitor.py @@ -188,13 +188,13 @@ class Monitor: mac=_("No physical address") # ip address try: - res = self.ioctl(0x8915, struct.pack('256s', ifname[:15]))[20:24] + res = self.ioctl(0x8915, struct.pack('256s',bytes(ifname[:15], 'utf-8')))[20:24] addr=socket.inet_ntoa(res) except: addr=_("No address assigned") # mac address try: - mac_struct=self.ioctl(0x8927, struct.pack('256s', ifname[:15]))[18:24] + mac_struct=self.ioctl(0x8927, struct.pack('256s', bytes(ifname[:15], 'utf-8')))[18:24] mac=":".join(["%02x" % ord(char) for char in mac_struct]) except: addr=_("No address assigned") |