From owner-cvs-all@FreeBSD.ORG Sat Aug 20 21:32:09 2005 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A950516A41F; Sat, 20 Aug 2005 21:32:09 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4ADE843D5D; Sat, 20 Aug 2005 21:32:09 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j7KLW96d075586; Sat, 20 Aug 2005 21:32:09 GMT (envelope-from rwatson@repoman.freebsd.org) Received: (from rwatson@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j7KLW9eY075585; Sat, 20 Aug 2005 21:32:09 GMT (envelope-from rwatson) Message-Id: <200508202132.j7KLW9eY075585@repoman.freebsd.org> From: Robert Watson Date: Sat, 20 Aug 2005 21:32:09 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: RELENG_6 Cc: Subject: cvs commit: src/sys/netinet ip_output.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Aug 2005 21:32:09 -0000 rwatson 2005-08-20 21:32:09 UTC FreeBSD src repository Modified files: (Branch: RELENG_6) sys/netinet ip_output.c Log: Merge ip_output.c:1.244 from HEAD to RELENG_6: Add helper function ip_findmoptions(), which accepts an inpcb, and attempts to atomically return either an existing set of IP multicast options for the PCB, or a newlly allocated set with default values. The inpcb is returned locked. This function may sleep. Call ip_moptions() to acquire a reference to a PCB's socket options, and perform the update of the options while holding the PCB lock. Release the lock before returning. Remove garbage collection of multicast options when values return to the default, as this complicates locking substantially. Most applications allocate a socket either to be multicast, or not, and don't tend to keep around sockets that have previously been used for multicast, then used for unicast. This closes a number of race conditions involving multiple threads or processes modifying the IP multicast state of a socket simultaenously. Approved by: re (scottl) Revision Changes Path 1.242.2.1 +58 -33 src/sys/netinet/ip_output.c