[Bug 277435] [Feature request] Add an option to destroy the tap/tun interface when the descriptor is closed
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 03 Mar 2024 14:50:11 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277435 --- Comment #4 from Nikolay Borodin <monsterovich@gmail.com> --- (In reply to Kyle Evans from comment #3) > though you can destroy it, you just have to close it first You can't. If you try to do this via SIOCIFDESTROY inside an application which uses the descriptor, the application will hang, even if you do ioctl after close(fd) The sample code from my application: JFUNC(void, close) { close(getFd(env, this)); struct ifreq ifr; memset(&ifr, 0, sizeof(ifr)); strcpy(ifr.ifr_name, "tap0"); int sock = socket(PF_INET, SOCK_STREAM, 0); ioctl(sock, SIOCIFDESTROY, &ifr); // hangs } After that, you can only terminate the application via kill -9 <pid>. -- You are receiving this mail because: You are the assignee for the bug.