]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
iptuntap: avoid double open
authorDan McGee <dan@archlinux.org>
Wed, 31 Aug 2011 19:14:51 +0000 (12:14 -0700)
committerStephen Hemminger <shemminger@vyatta.com>
Wed, 31 Aug 2011 19:14:51 +0000 (12:14 -0700)
would leak a file handle

ip/iptuntap.c

index 2a8aa7fc834f06de239d219d6b142359fb56b4c7..588926cf2bc1216b2419218a5d5f66725cefc854 100644 (file)
@@ -47,7 +47,7 @@ static void usage(void)
 
 static int tap_add_ioctl(struct ifreq *ifr, uid_t uid, gid_t gid)
 {
-       int fd = open(TUNDEV, O_RDWR);
+       int fd;
        int ret = -1;
 
 #ifdef IFF_TUN_EXCL