Commit a5f1257f authored by Martín Ferrari's avatar Martín Ferrari

Remove some dead code

parent ad450a2a
...@@ -915,8 +915,6 @@ def create_tap(iface, use_pi = False): ...@@ -915,8 +915,6 @@ def create_tap(iface, use_pi = False):
mode |= IFF_NO_PI mode |= IFF_NO_PI
fd = os.open("/dev/net/tun", os.O_RDWR) fd = os.open("/dev/net/tun", os.O_RDWR)
if fd == -1:
raise RuntimeError("Could not open /dev/net/tun")
err = fcntl.ioctl(fd, TUNSETIFF, struct.pack("16sH", iface.name, mode)) err = fcntl.ioctl(fd, TUNSETIFF, struct.pack("16sH", iface.name, mode))
if err < 0: if err < 0:
...@@ -926,12 +924,8 @@ def create_tap(iface, use_pi = False): ...@@ -926,12 +924,8 @@ def create_tap(iface, use_pi = False):
try: try:
set_if(iface) set_if(iface)
except: except:
(t, v, bt) = sys.exc_info()
try:
os.close(fd) os.close(fd)
except: raise
pass
raise t, v, bt
interfaces = get_if_data()[1] interfaces = get_if_data()[1]
return interfaces[iface.name], fd return interfaces[iface.name], fd
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment