summaryrefslogtreecommitdiffstats
path: root/sys/net/if_tun.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2013-10-02 20:44:36 +0000
committerglebius <glebius@FreeBSD.org>2013-10-02 20:44:36 +0000
commit515e096f7236fe4f554e196c769fc056df993849 (patch)
tree4643f180d2b885c00b25edd92bcb3a443f7d3d45 /sys/net/if_tun.c
parent3f1d7fea0ef65364bd48c79e15a8adb62926b908 (diff)
downloadFreeBSD-src-515e096f7236fe4f554e196c769fc056df993849.zip
FreeBSD-src-515e096f7236fe4f554e196c769fc056df993849.tar.gz
Clear knlist before destroying it in tap(4) and tun(4). This fixes later
crash, when a kqueue descriptor tries to dereference appropriate knotes. Approved by: re (kib)
Diffstat (limited to 'sys/net/if_tun.c')
-rw-r--r--sys/net/if_tun.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index f44bc0e..f36e7ad 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -258,6 +258,7 @@ tun_destroy(struct tun_softc *tp)
if_free(TUN2IFP(tp));
destroy_dev(dev);
seldrain(&tp->tun_rsel);
+ knlist_clear(&tp->tun_rsel.si_note, 0);
knlist_destroy(&tp->tun_rsel.si_note);
mtx_destroy(&tp->tun_mtx);
cv_destroy(&tp->tun_cv);
OpenPOWER on IntegriCloud