Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753764AbcLKQoi (ORCPT ); Sun, 11 Dec 2016 11:44:38 -0500 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:26542 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753558AbcLKQog (ORCPT ); Sun, 11 Dec 2016 11:44:36 -0500 Date: Sun, 11 Dec 2016 17:44:13 +0100 From: Willy Tarreau To: "Jason A. Donenfeld" Cc: linux-mips@linux-mips.org, Netdev , LKML , Dan =?iso-8859-1?Q?L=FCdtke?= , =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= , Hannes Frederic Sowa , WireGuard mailing list , Greg KH , Felix Fietkau , Jiri Benc , David Miller 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 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 937 Lines: 22 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