Fix NO_PI detection in netns
authorClaudio-Daniel Freire <claudio-daniel.freire@inria.fr>
Mon, 5 Sep 2011 01:20:01 +0000 (03:20 +0200)
committerClaudio-Daniel Freire <claudio-daniel.freire@inria.fr>
Mon, 5 Sep 2011 01:20:01 +0000 (03:20 +0200)
src/nepi/testbeds/netns/metadata.py

index 8c04d99..9875c23 100644 (file)
@@ -75,7 +75,7 @@ def connect_tunchannel_tap(testbed_instance, chan_guid, tap_guid):
         IFF_NO_PI = 0x00001000
         struct_ifreq = "x"*16+"H"+"x"*22
         flags = struct.unpack(struct_ifreq,
-            fcntl.ioctl(tap.fd, TUNGETIFF, struct.pack(struct_ifreq,0)) )
+            fcntl.ioctl(tap.fd, TUNGETIFF, struct.pack(struct_ifreq,0)) )[0]
         with_pi = (0 == (flags & IFF_NO_PI))
     except:
         # maybe the kernel doesn't support the IOCTL,