From patchwork Fri Jul 24 08:59:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dichtel X-Patchwork-Id: 499639 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 2CF04140776 for ; Fri, 24 Jul 2015 19:03:20 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753571AbbGXJDQ (ORCPT ); Fri, 24 Jul 2015 05:03:16 -0400 Received: from host.76.145.23.62.rev.coltfrance.com ([62.23.145.76]:50613 "EHLO proxy.6wind.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753213AbbGXJDO (ORCPT ); Fri, 24 Jul 2015 05:03:14 -0400 Received: from schnaps.dev.6wind.com (unknown [10.16.0.7]) by proxy.6wind.com (Postfix) with ESMTPS id AD989246E3; Fri, 24 Jul 2015 11:03:04 +0200 (CEST) Received: from root by schnaps.dev.6wind.com with local (Exim 4.80) (envelope-from ) id 1ZIYsj-0001DQ-27; Fri, 24 Jul 2015 11:03:05 +0200 From: Nicolas Dichtel To: davem@davemloft.net Cc: netdev@vger.kernel.org, Nicolas Dichtel , Thomas Graf , Roopa Prabhu Subject: [PATCH net-next] ipv6: use lwtunnel_output6() only if flag redirect is set Date: Fri, 24 Jul 2015 10:59:41 +0200 Message-Id: <1437728381-4603-1-git-send-email-nicolas.dichtel@6wind.com> X-Mailer: git-send-email 2.4.2 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This function make sense only when LWTUNNEL_STATE_OUTPUT_REDIRECT is set. The check is already done in IPv4. CC: Thomas Graf CC: Roopa Prabhu Fixes: 74a0f2fe8ed5 ("ipv6: rt6_info output redirect to tunnel output") Signed-off-by: Nicolas Dichtel Acked-by: Thomas Graf Acked-by: Roopa Prabhu --- net/ipv6/route.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index f216cb998628..67b2367126f3 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -1780,7 +1780,8 @@ int ip6_route_add(struct fib6_config *cfg) goto out; lwtunnel_state_get(lwtstate); rt->rt6i_lwtstate = lwtstate; - rt->dst.output = lwtunnel_output6; + if (lwtunnel_output_redirect(rt->rt6i_lwtstate)) + rt->dst.output = lwtunnel_output6; } ipv6_addr_prefix(&rt->rt6i_dst.addr, &cfg->fc_dst, cfg->fc_dst_len);