From owner-freebsd-net@FreeBSD.ORG Fri Oct 5 13:39:22 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 84A9C106566C; Fri, 5 Oct 2012 13:39:22 +0000 (UTC) (envelope-from rizzo.unipi@gmail.com) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id BBCA68FC17; Fri, 5 Oct 2012 13:39:21 +0000 (UTC) Received: by mail-ee0-f54.google.com with SMTP id c50so1479399eek.13 for ; Fri, 05 Oct 2012 06:39:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=s/0btmeNVjieDXGglPHzL7TasNwXzAKiU7KaemUcQwM=; b=qMq0G9Ub0wWe7FGXV/LOqJhetblg/S19BNZfInH1lZC4kLiuoMGqoW1cNntB3shlHI kEDCrsxDWNvpQV/8uOvJRa6FnT+86I5zaazhGkf2EeOUfaXeBNajZeRLPdY5OgEBvVR2 hjHoCDKSHWygxTGviiJAtv//r4UeKPUPq5Hkv/nnW+Us8l8GiuvnfNYjFaJEWg2W5MU1 R8LUzR+gCyrVXr0Fh8cwY55Uu/sEHPlaSO+26wjw3voKOnaCOxvkr9Upene7Fo7Vkvot ydnV6gGD9B6WlYiecuQUKuHC/ho580FcV3Ubj/GyY+41hkyOEL+U4Eu1lreeMQW8js53 LkNQ== MIME-Version: 1.0 Received: by 10.14.184.134 with SMTP id s6mr12989242eem.46.1349444360599; Fri, 05 Oct 2012 06:39:20 -0700 (PDT) Sender: rizzo.unipi@gmail.com Received: by 10.14.193.193 with HTTP; Fri, 5 Oct 2012 06:39:20 -0700 (PDT) In-Reply-To: <20121005131228.GQ34622@glebius.int.ru> References: <20121005114716.GP34622@FreeBSD.org> <20121005131228.GQ34622@glebius.int.ru> Date: Fri, 5 Oct 2012 06:39:20 -0700 X-Google-Sender-Auth: ilA88dGxjoofZEWUIvf_dvcl3rA Message-ID: From: Luigi Rizzo To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Ermal Lu?i , 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:39:22 -0000 On Fri, Oct 5, 2012 at 6:12 AM, Gleb Smirnoff wrote: > 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. > Good. I too wanted to be sure that the change is a step towards "everything in NET order" even though nobody expects you to do it all at once. (having everything in the same byte order is obviously useful because one does not need to deal with the differences, but having everything in wire format is even more interesting because it eventually makes buffers readonly). cheers luigi