From owner-cvs-src@FreeBSD.ORG Thu Aug 25 04:55:49 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.org 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 76BAC16A41F; Thu, 25 Aug 2005 04:55:49 +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 4796543D46; Thu, 25 Aug 2005 04:55:49 +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 j7P4tn2b009217; Thu, 25 Aug 2005 04:55:49 GMT (envelope-from rwatson@repoman.freebsd.org) Received: (from rwatson@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j7P4tnVY009216; Thu, 25 Aug 2005 04:55:49 GMT (envelope-from rwatson) Message-Id: <200508250455.j7P4tnVY009216@repoman.freebsd.org> From: Robert Watson Date: Thu, 25 Aug 2005 04:55:48 +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/net if.c if.h if_var.h rtsock.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 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: Thu, 25 Aug 2005 04:55:49 -0000 rwatson 2005-08-25 04:55:48 UTC FreeBSD src repository Modified files: (Branch: RELENG_6) sys/net if.c if.h if_var.h rtsock.c Log: Merge if.c:1.242, if.h:1.97, if_var.h:1.102, rtsock.c:1.125 from HEAD to RELENG_6: Rename IFF_RUNNING to IFF_DRV_RUNNING, IFF_OACTIVE to IFF_DRV_OACTIVE, and move both flags from ifnet.if_flags to ifnet.if_drv_flags, making and documenting the locking of these flags the responsibility of the device driver, not the network stack. The flags for these two fields will be mutually exclusive so that they can be exposed to user space as though they were stored in the same variable. Provide #defines to provide the old names #ifndef _KERNEL, so that user applications (such as ifconfig) can use the old flag names. Using the old names in a device driver will result in a compile error in order to help device driver writers adopt the new model. When exposing the interface flags to user space, via interface ioctls or routing sockets, or the two fields together. Since the driver flags cannot currently be set for user space, no new logic is currently required to handle this case. Add some assertions that general purpose network stack routines, such as if_setflags(), are not improperly used on driver-owned flags. With this change, a large number of very minor network stack races are closed, subject to correct device driver locking. Most were likely never triggered. Driver sweep to follow; many thanks to pjd and bz for the line-by-line review they gave this patch. Reviewed by: pjd, bz Approved by: re (scottl) Revision Changes Path 1.234.2.8 +19 -5 src/sys/net/if.c 1.96.2.1 +28 -3 src/sys/net/if.h 1.98.2.4 +5 -1 src/sys/net/if_var.h 1.123.2.2 +3 -2 src/sys/net/rtsock.c