#ifdef HAVE_NET_IF_H
#include <net/if.h>
-#ifdef HAVE_LINUX_IF_H
+#ifdef HAVE_LINUX_IF_TUN_H
#include <linux/if_tun.h>
#define LINUX_TUN_SUPPORTED
#endif
tun_set_route(st,r);
}
+ add_hook(PHASE_CHILDPERSIST,childpersist_closefd_hook,&st->fd);
+
/* Register for poll() */
register_for_poll(st, tun_beforepoll, tun_afterpoll, st->nl.name);
}
dict_t *dict;
string_t flavour,type;
- st=safe_malloc(sizeof(*st),"tun_apply");
+ NEW(st);
/* First parameter must be a dict */
item=list_elem(args,0);