If the unit being closed was a "zombie" (ie, the interface was destroyed

previously), remove it from the zombie list after freeing all of its
resources.

This should allow the module to be unloaded even if there was a zombie
at some point.  Without this change, the zombie list never gets emptied.
This commit is contained in:
pgoyette 2019-03-25 00:55:28 +00:00
parent e09538bda2
commit 1b628ee76c

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_tun.c,v 1.147 2018/09/03 16:29:35 riastradh Exp $ */
/* $NetBSD: if_tun.c,v 1.148 2019/03/25 00:55:28 pgoyette Exp $ */
/*
* Copyright (c) 1988, Julian Onions <jpo@cs.nott.ac.uk>
@ -19,7 +19,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.147 2018/09/03 16:29:35 riastradh Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.148 2019/03/25 00:55:28 pgoyette Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@ -370,6 +370,7 @@ tunclose(dev_t dev, int flag, int mode,
softint_disestablish(tp->tun_isih);
mutex_destroy(&tp->tun_lock);
kmem_free(tp, sizeof(*tp));
LIST_REMOVE(tp, tunz_list);
return 0;
}