Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932765AbcLHWUL (ORCPT ); Thu, 8 Dec 2016 17:20:11 -0500 Received: from frisell.zx2c4.com ([192.95.5.64]:37990 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752139AbcLHWUK (ORCPT ); Thu, 8 Dec 2016 17:20:10 -0500 MIME-Version: 1.0 In-Reply-To: <20161207.193716.50344961208535056.davem@davemloft.net> References: <20161207.145240.1636297838792223189.davem@davemloft.net> <20161207.193716.50344961208535056.davem@davemloft.net> From: "Jason A. Donenfeld" Date: Thu, 8 Dec 2016 23:20:04 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Misalignment, MIPS, and ip_hdr(skb)->version To: David Miller Cc: Dave Taht , Netdev , linux-mips@linux-mips.org, LKML , WireGuard mailing list Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 594 Lines: 15 Hi David, On Thu, Dec 8, 2016 at 1:37 AM, David Miller wrote: > You really have to land the IP header on a proper 4 byte boundary. > > I would suggest pushing 3 dummy garbage bytes of padding at the front > or the end of your header. Are you sure 3 bytes to get 4 byte alignment is really the best? I was thinking that adding 1 byte to get 2 byte alignment might be better, since it would then ensure that the subsequent TCP header winds up being 4 byte aligned. Or is this in fact not the desired trade off, and so I should stick with the 3 bytes you suggested? Jason