if_tun: Disallow to destroy an opened device
authorAaron LI <aly@aaronly.me>
Thu, 30 Aug 2018 13:36:07 +0000 (21:36 +0800)
committerAaron LI <aly@aaronly.me>
Thu, 30 Aug 2018 13:40:44 +0000 (21:40 +0800)
commit252be4c402afa5c4e35b827f272e3c52e8dbe46f
tree88262c624fe50b736c1c546d70dd54e8fefd3a20
parentceddbcf65305e80699502a2797f0ef944f53b3a7
if_tun: Disallow to destroy an opened device

When a tun 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.

Following the previous fix to if_tap.
sys/net/tun/if_tun.c