From owner-freebsd-pf@FreeBSD.ORG Mon Jan 30 18:47:10 2012 Return-Path: Delivered-To: freebsd-pf@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 971771065672; Mon, 30 Jan 2012 18:47:10 +0000 (UTC) (envelope-from bz@freebsd.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 23C6D8FC0C; Mon, 30 Jan 2012 18:47:10 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 0967F25D37C3; Mon, 30 Jan 2012 18:47:08 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 1E71BBDA4CD; Mon, 30 Jan 2012 18:47:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id vf0oJpAzHN9E; Mon, 30 Jan 2012 18:47:07 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 010B3BDA4CB; Mon, 30 Jan 2012 18:47:06 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <20120130182459.GA1096@thorin> Date: Mon, 30 Jan 2012 18:47:06 +0000 Content-Transfer-Encoding: 7bit Message-Id: References: <20120130182459.GA1096@thorin> To: Robert Millan X-Mailer: Apple Mail (2.1084) Cc: Adrian Chadd , mlaier@freebsd.org, Kostik Belousov , freebsd-pf@freebsd.org Subject: Re: [PATCH] GNU/kFreeBSD detection in PF X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 18:47:10 -0000 On 30. Jan 2012, at 18:24 , Robert Millan wrote: > > Hi, > > Please consider attached patch (since it's so large you may find it > easier to read with grep "^[+-]") to fix detection of GNU/kFreeBSD in PF. > > Note: since this code is part of FreeBSD, the __FreeBSD_kernel__ macro > may be relied on when has been included. For simplicity, > this patch switches __FreeBSD__ to __FreeBSD_kernel__ for C files while > adding the #include if missing. > > For header files, instead of adding a new #include I opted for checking > both macros, to avoid header pollution. > > This patch fixes most (but not all) __FreeBSD__ checks and adds missing > #includes where appropiate, but doesn't change anything else. Since the > patch is so big, I wanted to keep it as simple as possible. As posted previously to freebsd-pf we shall unifdef pf as soon as someone get some other work in, so the entire #ifdef __FreeBSD__ checks would be gone. I think that's a lot better solution than further mangling things. /bz -- Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do!