git: DragonFly_RELEASE_5_2 if_tap: Disallow to destroy an opened device
aly at crater.dragonflybsd.org
Thu Aug 30 06:58:12 PDT 2018
Author: Aaron LI <aly at aaronly.me>
Date: Thu Aug 30 21:13:27 2018 +0800
if_tap: Disallow to destroy an opened device
When a tap device (created via 'ifconfig') is opened, disallow to destroy
it (e.g., ifconfig destroy). Otherwise, a panic occurs when the caller
closes the device, since it has been already destroyed.
[A]% ifconfig tap0 create
[B]% # run a program that opens '/dev/tap0' and keep it running
[A]% ifconfig tap0 destroy
[B]% # exit the program which will then close '/dev/tap0'
* Add an assertion to tapclose() to assert the device must exist.
* Return EINVAL instead of ENOIX when try to destroy an manually created
Summary of changes:
sys/net/tap/if_tap.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
DragonFly BSD source repository
More information about the Commits