Don't destroy tun on SIGHUP

This commit is contained in:
Adrien Gallouët
2017-02-10 11:54:19 +00:00
parent bbf1c12f7a
commit 355040f576
3 changed files with 23 additions and 5 deletions

View File

@@ -17,6 +17,7 @@
#define IFF_TUN 0x0001
#define IFF_NO_PI 0x1000
#define TUNSETIFF _IOW('T', 202, int)
#define TUNSETPERSIST _IOW('T', 203, int)
#endif
#ifdef __APPLE__
@@ -260,3 +261,9 @@ tun_set_mtu(char *dev_name, int mtu)
return ret;
}
int
tun_set_persist(int fd, int on)
{
return ioctl(fd, TUNSETPERSIST, on);
}