From mboxrd@z Thu Jan 1 00:00:00 1970 From: Willy Tarreau Subject: Re: Misalignment, MIPS, and ip_hdr(skb)->version Date: Sun, 11 Dec 2016 17:44:13 +0100 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-Transfer-Encoding: 7bit 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 To: "Jason A. Donenfeld" Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: wireguard-bounces@lists.zx2c4.com Sender: "WireGuard" List-Id: netdev.vger.kernel.org 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