From owner-freebsd-net@FreeBSD.ORG Fri Oct 5 13:12:30 2012 Return-Path: Delivered-To: net@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DB783106566C; Fri, 5 Oct 2012 13:12:30 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 54D628FC0A; Fri, 5 Oct 2012 13:12:30 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q95DCSld051955; Fri, 5 Oct 2012 17:12:28 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q95DCSKX051954; Fri, 5 Oct 2012 17:12:28 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 5 Oct 2012 17:12:28 +0400 From: Gleb Smirnoff To: Ermal Lu?i Message-ID: <20121005131228.GQ34622@glebius.int.ru> References: <20121005114716.GP34622@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: net@FreeBSD.org Subject: Re: [PATCH] resolve byte order mess in ip_input/ip_output/pfil(9) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Oct 2012 13:12:31 -0000 Ermal, On Fri, Oct 05, 2012 at 03:01:38PM +0200, Ermal Lu?i wrote: E> it would be better to switch to net byte order allover rather than E> trade one for the other. E> This makes it even more tricky to understand the code than it is. E> If you do the work its better to do the full thing in one shot and E> switch to netbyte order. Please read carefully my description and patch. It creates a definite points in stack where byte order is swapped. One point where it is swapped into host, and one point where it is swapped back into net. Patch already narrows down the scope of host byte order in the stack, host byte order is now between to definite points. If anyone ever wants to switch entire stack to net byte order, let it be. Current patch is just step in this direction. The fast forwarding path is already entirely in net byte order. Even if run with ipfw and/or pf. E> speaking of pf(4) side of things please do not loose the VIMAGE calls! Yeah, can you explain please why do we need them here? The pfil hooks are always run already in some defined VNET context, don't they? -- Totus tuus, Glebius.