fix warning
[sliver-openvswitch.git] / lib / tunalloc.c
index 1f083e5..b2484b9 100644 (file)
@@ -6,10 +6,12 @@
  * new tuntap interface. Interface name can be acquired via TUNGETIFF ioctl.
  */
 
+#include <config.h>
 #include <sys/un.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#include <unistd.h>
 #include <errno.h>
 #include <sys/socket.h>
 #include <linux/if.h>
@@ -97,5 +99,8 @@ int tun_alloc(int iftype, char *if_name)
     }
 
     remotefd = receive_vif_fd(control_fd, if_name);
+
+    close(control_fd);
+
     return remotefd;
 }