Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753838Ab3JFQTO (ORCPT ); Sun, 6 Oct 2013 12:19:14 -0400 Received: from order.stressinduktion.org ([87.106.68.36]:43961 "EHLO order.stressinduktion.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753474Ab3JFQTM (ORCPT ); Sun, 6 Oct 2013 12:19:12 -0400 Date: Sun, 6 Oct 2013 18:19:10 +0200 From: Hannes Frederic Sowa To: Oussama Ghorbel Cc: "David S. Miller" , Alexey Kuznetsov , James Morris , Hideaki YOSHIFUJI , Patrick McHardy , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Fix the upper MTU limit in ipv6 GRE tunnel Message-ID: <20131006161910.GC9295@order.stressinduktion.org> Mail-Followup-To: Oussama Ghorbel , "David S. Miller" , Alexey Kuznetsov , James Morris , Hideaki YOSHIFUJI , Patrick McHardy , netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <1380880333-3546-1-git-send-email-ou.ghorbel@gmail.com> <20131005140636.GA25076@order.stressinduktion.org> <20131006151351.GB9295@order.stressinduktion.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1672 Lines: 45 On Sun, Oct 06, 2013 at 04:36:56PM +0100, Oussama Ghorbel wrote: > On Sun, Oct 6, 2013 at 4:13 PM, Hannes Frederic Sowa > wrote: > > On Sun, Oct 06, 2013 at 03:42:15PM +0100, Oussama Ghorbel wrote: > >> The initialization in ip6gre_tnl_link_config is done as the following: > >> static void ip6gre_tnl_link_config(struct ip6_tnl *t, int set_mtu) > >> { > >> ... > >> int addend = sizeof(struct ipv6hdr) + 4; > >> ... > >> /* Precalculate GRE options length */ > >> if (t->parms.o_flags&(GRE_CSUM|GRE_KEY|GRE_SEQ)) { > >> if (t->parms.o_flags&GRE_CSUM) > >> addend += 4; > >> if (t->parms.o_flags&GRE_KEY) > >> addend += 4; > >> if (t->parms.o_flags&GRE_SEQ) > >> addend += 4; > >> } > >> ... > >> dev->hard_header_len = rt->dst.dev->hard_header_len + addend; > >> ... > >> t->hlen = addend; > >> .. > >> } > >> > >> Unless they are other reasons, the hard_header_len is taken into > >> account the GRE_KEY, GRE_SEQ .. > > > > But only if a new route is found. The hard_header_len reinitialization is > > guarded by a (rt == NULL). We may have not found one on boot up. > > > In that case the function will make a return and hlen will be zero. > Subtracting hlen in ip6gre_tunnel_change_mtu has no effect ... Oh yes, somehow I missed that. We depend on t->hlen when pushing the gre header onto the skb. t->hlen == 0 should never be the case because we assume t->hlen > sizeof(struct ipv6_hdr). -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/