From owner-cvs-src-old@FreeBSD.ORG Fri Oct 15 15:06:45 2010 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A35C81065740 for ; Fri, 15 Oct 2010 15:06:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 913AE8FC12 for ; Fri, 15 Oct 2010 15:06:45 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.4/8.14.4) with ESMTP id o9FF6ji9071696 for ; Fri, 15 Oct 2010 15:06:45 GMT (envelope-from bz@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id o9FF6j2Q071695 for cvs-src-old@freebsd.org; Fri, 15 Oct 2010 15:06:45 GMT (envelope-from bz@repoman.freebsd.org) Message-Id: <201010151506.o9FF6j2Q071695@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to bz@repoman.freebsd.org using -f From: "Bjoern A. Zeeb" Date: Fri, 15 Oct 2010 15:06:32 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: RELENG_7 Subject: cvs commit: src/sys/net if_tun.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 15:06:45 -0000 bz 2010-10-15 15:06:32 UTC FreeBSD src repository Modified files: (Branch: RELENG_7) sys/net if_tun.c Log: SVN rev 213895 on 2010-10-15 15:06:32Z by bz MFC r186391,186483,186497 (qingli, kmacy 21 months ago): r186391: Provide a condition variable to delay the cloned interface destroy operation until the referenced clone device has been closed by the process properly. The behavior is now consistently with the previous release. r186483: - Close a race during which the open flag could be cleared but the tun_softc would still be referenced by adding a separate TUN_CLOSED flag that is set after tunclose is done referencing it. - drop the tun_mtx after the flag check to avoid holding it across if_detach which can recurse in to if_tun.c r186497: The "tun?" dev need not be opened at all. One is allowed to perform the following operations, e.g.: 1) ifconfig tun0 create 2) ifconfig tun0 10.1.1.1 10.1.1.2 3) route add -net 192.103.54.0/24 -iface tun0 4) ifconfig tun0 destroy If cv wait on the TUN_CLOSED flag, then the last operation (4) will block forever. Revert the previous changes and fix the mtx_unlock() leak. PR: kern/116837 Submitted by: Mikolaj Golub (to.my.trociny gmail.com) (Not used the patch, just did the MFC) Revision Changes Path 1.163.2.5 +11 -2 src/sys/net/if_tun.c