From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: w@1wt.eu Received: from krantz.zx2c4.com (localhost [127.0.0.1]) by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 105dbc43 for ; Sun, 11 Dec 2016 16:38:28 +0000 (UTC) Received: from 1wt.eu (wtarreau.pck.nerim.net [62.212.114.60]) by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id f9ee8689 for ; Sun, 11 Dec 2016 16:38:27 +0000 (UTC) Date: Sun, 11 Dec 2016 17:44:13 +0100 From: Willy Tarreau To: "Jason A. Donenfeld" Subject: Re: Misalignment, MIPS, and ip_hdr(skb)->version Message-ID: <20161211164413.GA5090@1wt.eu> References: <095cac5b-b757-6f4a-e699-8eedf9ed7221@stressinduktion.org> <87vauvhwdu.fsf@alice.fifthhorseman.net> <20161211071501.GA32621@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: Cc: linux-mips@linux-mips.org, =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= , LKML , Jiri Benc , Hannes Frederic Sowa , Netdev , David Miller , WireGuard mailing list , Felix Fietkau List-Id: Development discussion of WireGuard List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Sun, Dec 11, 2016 at 03:50:31PM +0100, Jason A. Donenfeld wrote: > 3. Add 3 bytes of padding, set to zero, to the encrypted section just > before the IP header, marked for future use. > Pros: satisfies IETF mantras, can use those extra bits in the future > for interesting protocol extensions for authenticated peers. > Cons: lowers MTU, marginally more difficult to implement but still > probably just one or two lines of code. > > Of these, I'm leaning toward (3). Or 4) add one byte to the cleartext header for future use (mostly flags maybe) and 2 bytes of padding to the encrypted header. This way you get the following benefits : 1) your encrypted text is at least 16-bit aligned, maybe it matters in your checksum computations on during decryption 2) your MTU remains even, this is better for both ends 3) you're free to add some bits either to the encrypted or the clear parts. Just a suggestion :-) Willy