From owner-cvs-src@FreeBSD.ORG  Wed Jul 28 18:16:49 2004
Return-Path: <owner-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 5D10116A4D1; Wed, 28 Jul 2004 18:16:49 +0000 (GMT)
Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57])
	by mx1.FreeBSD.org (Postfix) with ESMTP
	id CB1B443D58; Wed, 28 Jul 2004 18:16:48 +0000 (GMT)
	(envelope-from scottl@samsco.org)
Received: from [192.168.2.73] (cpe.125.wat.v126.packetworks.net
	[64.235.97.125] (may be forged))	(authenticated bits=0)
	by pooker.samsco.org (8.12.11/8.12.10) with ESMTP id i6SINfgw015610;
	Wed, 28 Jul 2004 12:23:42 -0600 (MDT)
	(envelope-from scottl@samsco.org)
Message-ID: <4107ED15.8000202@samsco.org>
Date: Wed, 28 Jul 2004 12:14:45 -0600
From: Scott Long <scottl@samsco.org>
User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7) Gecko/20040702
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Brooks Davis <brooks@one-eyed-alien.net>
References: <Pine.NEB.3.96L.1040728125025.26103B-100000@fledge.watson.org>
	<4107E0F6.8060902@samsco.org> <20040728180711.GA31842@Odin.AC.HMC.Edu>
In-Reply-To: <20040728180711.GA31842@Odin.AC.HMC.Edu>
X-Enigmail-Version: 0.84.2.0
X-Enigmail-Supports: pgp-inline, pgp-mime
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Status: No, hits=0.0 required=3.8 tests=none autolearn=no version=2.63
X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on pooker.samsco.org
cc: src-committers@FreeBSD.org
cc: cvs-src@FreeBSD.org
cc: Alfred Perlstein <alfred@FreeBSD.org>
cc: cvs-all@FreeBSD.org
cc: Robert Watson <rwatson@FreeBSD.org>
cc: Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
Subject: Re: cvs commit: src/sys/sys _task.h
X-BeenThere: cvs-src@freebsd.org
X-Mailman-Version: 2.1.1
Precedence: list
List-Id: CVS commit messages for the src tree <cvs-src.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/cvs-src>,
	<mailto:cvs-src-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/cvs-src>
List-Post: <mailto:cvs-src@freebsd.org>
List-Help: <mailto:cvs-src-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/cvs-src>,
	<mailto:cvs-src-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 28 Jul 2004 18:16:49 -0000

Brooks Davis wrote:
> On Wed, Jul 28, 2004 at 11:23:02AM -0600, Scott Long wrote:
> 
>>Robert Watson wrote:
>>
>>>On Wed, 28 Jul 2004, Garrett Wollman wrote:
>>>
>>>
>>>
>>>><<On Wed, 28 Jul 2004 08:03:16 -0700, Alfred Perlstein 
>>>><alfred@FreeBSD.ORG> said:
>>>>
>>>>
>>>>
>>>>>* Maxime Henrion <mux@freebsd.org> [040728 02:19] wrote:
>>>>>
>>>>>
>>>>>>Or have a struct ifnet for kernel and a struct xifnet for userland, as 
>>>>>>we
>>>>>>do in other places.
>>>>
>>>>>That sounds more correct (xifnet).
>>>>
>>>>No.  Everything that would legitimately be available in an xifnet
>>>>structure is already made available through other interfaces.  The only
>>>>reason programs might need to look at a struct ifnet is because they're
>>>>mucking about in kernel memory, in which case they need the real one and
>>>>not a "sanitized" version.  (This is why I moved struct ifnet to
>>>><net/if_var.h> in the first place.) 
>>>
>>>
>>>Some applications and libraries declare their known violation of layering
>>>boundaries in the system by #define _KERNEL.  Others structures have
>>>special #define's, such as COMPAT_43, _WANT_UCRED, etc.  I'd be happy with
>>>either #define _KERNEL or #if defined(_KERNEL) || _WANT_IFNET.
>>
>>I'd be quite happy with
>>
>>#ifndef _KERNEL
>>#error "No user-servicable parts inside"
>>
>>or similar as is in /sys/sys/timetc.h.  Either way, pollution bad,
>>fluffy bunnies good.
> 
> 
> First we need to get our house in order.  I count at least 52 includes
> of net/if_var.h in our userland.  We could go ahead and add:
> 
> #if defined(BURN_BRIDGES) && !defined(_KERNEL)
> #error "No user-servicable parts inside"
> #endif
> 
> That would break all the offenders when we branch without forcing us to
> deal with yet another thing before 5.3.
> 
> -- Brooks
> 

Sounds like a good plan to me.

Scott