git: if_tap: Disallow to destroy an opened device
aly at crater.dragonflybsd.org
Thu Aug 30 06:41:06 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
* Improve the function description a bit.
Summary of changes:
sys/net/tap/if_tap.c | 33 ++++++++++++++-------------------
1 file changed, 14 insertions(+), 19 deletions(-)
DragonFly BSD source repository
More information about the Commits