-
Notifications
You must be signed in to change notification settings - Fork 64
TUNTAP_MODE_PERSIST broken? #67
Copy link
Copy link
Open
Description
I tried to create a persistent tun0 on linux, but failed. While the setting of the persistence works ok, the logic in the file tuntap-unix-linux.c looks broken:
void
tuntap_sys_destroy(struct device *dev)
{
if (ioctl(dev->tun_fd, TUNSETPERSIST, 0) == -1) {
tuntap_log(TUNTAP_LOG_WARN, "Can't destroy the interface");
}
}
This function tries to unconditionally set the persistence to "do not persist" and only if the call fails logs a message which has not much to do with persistence.
To me it looks as if the author of the destroy function might have been in the believe that the 0 argument makes the ioctl read the current state. This is, however, not the case. The effect is that the persistence is cleared and it is impossible with libtuntap to create a persistent interface.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels