From owner-cvs-src@FreeBSD.ORG Sat Dec 20 13:03:50 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B70BF16A4D2; Sat, 20 Dec 2003 13:03:50 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C26EC43D49; Sat, 20 Dec 2003 13:03:45 -0800 (PST) (envelope-from sam@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id hBKIWn0B026116; Sat, 20 Dec 2003 10:32:49 -0800 (PST) (envelope-from sam@repoman.freebsd.org) Received: (from sam@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id hBKIWnlH026115; Sat, 20 Dec 2003 10:32:49 -0800 (PST) (envelope-from sam) Message-Id: <200312201832.hBKIWnlH026115@repoman.freebsd.org> From: Sam Leffler Date: Sat, 20 Dec 2003 10:32:49 -0800 (PST) To: src-committers@freebsd.org, cvs-src@freebsd.org, cvs-all@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/netinet ip_mroute.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Dec 2003 21:03:50 -0000 sam 2003/12/20 10:32:49 PST FreeBSD src repository Modified files: sys/netinet ip_mroute.c Log: o move mutex init/destroy logic to the module load/unload hooks; otherwise they are initialized twice when the code is statically configured in the kernel because the module load method gets invoked before the user application calls ip_mrouter_init o add a mutex to synchronize the module init/done operations; this sort of was done using the value of ip_mroute but X_ip_mrouter_done sets it to NULL very early on which can lead to a race against ip_mrouter_init--using the additional mutex means this is safe now o don't call ip_mrouter_reset from ip_mrouter_init; this now happens once at module load and X_ip_mrouter_done does the appropriate cleanup work to insure the data structures are in a consistent state so that a subsequent init operation inherits good state Reviewed by: juli Revision Changes Path 1.97 +27 -11 src/sys/netinet/ip_mroute.c