Branch: refs/heads/fix-nozzle-leak-bsd Home: https://github.com/kronosnet/kronosnet Commit: b01e885366956d701695c67d3c27150de2e22cd5 https://github.com/kronosnet/kronosnet/commit/b01e885366956d701695c67d3c2715... Author: Fabio M. Di Nitto fdinitto@redhat.com Date: 2023-09-18 (Mon, 18 Sep 2023)
Changed paths: M libnozzle/tests/test-common.c
Log Message: ----------- nozzle: don´t leak tun/tap interfaces in test suite
the need_tun() test check to verify that the kernel module for tun/tap is loaded, was opening a generic /dev/tun (or /dev/tap) to verify the presence of the kernel module.
On linux, closing the fd to the tap/tun device is enough to destroy the device.
On BSD the device is set to DOWN on closing the fd, but it´s not destroyed.
Stop leaking by gathering ifr ioctl info from the generic interface created by BSD and pass it to the ioctlfd to destroy.
Signed-off-by: Fabio M. Di Nitto fdinitto@redhat.com