From patchwork Thu May 15 08:35:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Timo Teras X-Patchwork-Id: 349091 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 4565414007D for ; Thu, 15 May 2014 18:35:23 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752221AbaEOIfQ (ORCPT ); Thu, 15 May 2014 04:35:16 -0400 Received: from mail-lb0-f179.google.com ([209.85.217.179]:44183 "EHLO mail-lb0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752167AbaEOIfM (ORCPT ); Thu, 15 May 2014 04:35:12 -0400 Received: by mail-lb0-f179.google.com with SMTP id c11so519320lbj.24 for ; Thu, 15 May 2014 01:35:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=xWZNNmMzaE8NZVHde0sKM1SoL8qHuke0jsREtIQDjUY=; b=zZ7ieUiLE52/T/EvORz0axW3ouytNoOzpy3DAdwptqKRmjZK18mRnVW8lluSFuAI7D tL8xF5I7ay8KNdudNd3+EbwE6UpvvXVwm6OPvAm+wYu0diOuTZhzIMCQ8hDrM4goikkt 9GVqhken6T1HhOHFUu+u4DfeNSV9baZvY/KvDsEMMHl5cC3Son29Zgul9y2PsIHDykoG A/cQkFogZJ/VOxFuHvOxixp3SNugcpe7ohMowtAJ7lVtQUr4v0JFWtjTGjujV8+5seuh 60TaQOL23Ptevpmh/IpXGhCT4i7E8fuVJVX0kS1nY0eSVH1xWM2ub8eucmbKE9TALyh/ Rt7w== X-Received: by 10.112.13.137 with SMTP id h9mr6040075lbc.33.1400142910199; Thu, 15 May 2014 01:35:10 -0700 (PDT) Received: from vostro.util.wtbts.net ([83.145.235.199]) by mx.google.com with ESMTPSA id sz5sm4630063lbb.33.2014.05.15.01.35.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 May 2014 01:35:09 -0700 (PDT) From: =?UTF-8?q?Timo=20Ter=C3=A4s?= To: netdev@vger.kernel.org Cc: =?UTF-8?q?Timo=20Ter=C3=A4s?= , Tom Herbert , Eric Dumazet Subject: [PATCH] ipv4: ip_tunnels: disable dst cache for nbma gre tunnels Date: Thu, 15 May 2014 11:35:17 +0300 Message-Id: <1400142917-1849-1-git-send-email-timo.teras@iki.fi> X-Mailer: git-send-email 1.9.3 In-Reply-To: <20140424151647.2a917ff1@vostro> References: <20140424151647.2a917ff1@vostro> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The connected check fails to check for ip_gre nbma mode tunnels properly. ip_gre creates temporary tnl_params with daddr specified to pass-in the actual target on per-packet basis from neighbor layer. Detect these tunnels by inspecting the actual tunnel configuration instead. Fixes: 7d442fab0a67 ("ipv4: Cache dst in tunnels") Signed-off-by: Timo Teräs Cc: Tom Herbert Cc: Eric Dumazet --- Should go to 3.14-stable too. (This does not fix all NBMA GRE regressions in 3.14. I'm also getting weird oopses from GRO; will post soon more info.) net/ipv4/ip_tunnel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c index e77381d..100caf5 100644 --- a/net/ipv4/ip_tunnel.c +++ b/net/ipv4/ip_tunnel.c @@ -538,9 +538,10 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, unsigned int max_headroom; /* The extra header space needed */ __be32 dst; int err; - bool connected = true; + bool connected; inner_iph = (const struct iphdr *)skb_inner_network_header(skb); + connected = (tunnel->daddr != 0); dst = tnl_params->daddr; if (dst == 0) {