From owner-cvs-src-old@FreeBSD.ORG Mon Aug 24 10:06:24 2009 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 955081065690 for ; Mon, 24 Aug 2009 10:06:24 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 83FE98FC1D for ; Mon, 24 Aug 2009 10:06:24 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n7OA6O0F040542 for ; Mon, 24 Aug 2009 10:06:24 GMT (envelope-from zec@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n7OA6ONj040541 for cvs-src-old@freebsd.org; Mon, 24 Aug 2009 10:06:24 GMT (envelope-from zec@repoman.freebsd.org) Message-Id: <200908241006.n7OA6ONj040541@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to zec@repoman.freebsd.org using -f From: Marko Zec Date: Mon, 24 Aug 2009 10:06:02 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/netinet ip_divert.c ip_divert.h 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: Mon, 24 Aug 2009 10:06:24 -0000 zec 2009-08-24 10:06:02 UTC FreeBSD src repository Modified files: sys/netinet ip_divert.c ip_divert.h Log: SVN rev 196502 on 2009-08-24 10:06:02Z by zec Introduce a div_destroy() function which takes over per-vnet cleanup tasks from the existing modevent / MOD_UNLOAD handler, and register div_destroy() in protosw as per-vnet .pr_destroy() handler for options VIMAGE builds. In nooptions VIMAGE builds, div_destroy() will be invoked from the modevent handler, resulting in effectively identical operation as it was prior this change. div_destroy() also tears down hashtables used by ipdivert, which were previously left behind on ipdivert kldunloads. For options VIMAGE builds only, temporarily disable kldunloading of ipdivert, because without introducing additional locking logic it is impossible to atomically check whether all ipdivert instances in all vnets are idle, and proceed with cleanup without opening a race window for a vnet to open an ipdivert socket while ipdivert tear-down is in progress. While here, staticize div_init(), because it is not used outside of ip_divert.c. In cooperation with: julian Approved by: re (rwatson), julian (mentor) MFC after: 3 days Revision Changes Path 1.157 +30 -5 src/sys/netinet/ip_divert.c 1.5 +0 -1 src/sys/netinet/ip_divert.h