From patchwork Fri Sep 25 21:13:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Ahern X-Patchwork-Id: 522999 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 23830140549 for ; Sat, 26 Sep 2015 07:13:26 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=cumulusnetworks.com header.i=@cumulusnetworks.com header.b=DmDtF+tT; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933354AbbIYVNI (ORCPT ); Fri, 25 Sep 2015 17:13:08 -0400 Received: from mail-pa0-f49.google.com ([209.85.220.49]:34309 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933346AbbIYVNG (ORCPT ); Fri, 25 Sep 2015 17:13:06 -0400 Received: by padhy16 with SMTP id hy16so115932056pad.1 for ; Fri, 25 Sep 2015 14:13:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cumulusnetworks.com; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type; bh=EFqEFApyBtQnq/7VtUBri4LdDra/G+pITqdUxHRGOPU=; b=DmDtF+tT7ROgVKawZtNcV02d4buOO64w4/B+O69kVjaIZRzoxdgs0SFMU3uFx9Htgw cLgUe6cXeKXa6wQRe549LWNsBGGI61smWds2C1IEH2qWnp0zyouhdZEVBg8PXL8yiKQV zfPlvr6JcwumrKun9zlQyutAnZx9tRiGVid/M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type; bh=EFqEFApyBtQnq/7VtUBri4LdDra/G+pITqdUxHRGOPU=; b=fQY1Z4GmgHZRi68qAMjAa0ZV5UajcdzCoVFHDRPX8mVDR38rbipRYPgfiU6p2yv/du L/C18z9PkXpAr8s2guY8FKIYLOnzm1VKg92UorDZVaL6rCXU2ZodSw9JoHAuaAStQ5hf U5vu09vzlKgpQpB3IP9LRUxJgCImcyr+i3+Z18SEe8ca2mQm0+wOvkzCCZgDipfHl10A kXf1ra+LU8XyJBVaBr4jecWgBF6TlrJcZ2WFSCCXHqmeoKg/eUh2WBSUucQRPDCK30us SNn9ih/a9rqv7m0CH7rxG8bm+2mnZk1ez0VPZR08SJSBOWTDsgSyFrSYuS3XXY6pS3K8 LL0w== X-Gm-Message-State: ALoCoQkDl/3OqnWdcwtRWiEY0o0ILWgfUYF7lt6vR38INnlbEKQmeLX/mwtumCnsAE0UNoKIEq+X X-Received: by 10.66.154.201 with SMTP id vq9mr10128250pab.105.1443215585574; Fri, 25 Sep 2015 14:13:05 -0700 (PDT) Received: from [192.168.1.28] ([174.51.92.64]) by smtp.googlemail.com with ESMTPSA id g5sm5579829pat.21.2015.09.25.14.13.03 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 25 Sep 2015 14:13:04 -0700 (PDT) Subject: Re: Forcing the output interface using ip6_route_output doesn't work To: Wolfgang Nothdurft , netdev@vger.kernel.org References: <560552A7.40305@linux-dude.de> From: David Ahern Message-ID: <5605B8DF.2070603@cumulusnetworks.com> Date: Fri, 25 Sep 2015 15:13:03 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <560552A7.40305@linux-dude.de> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 9/25/15 7:56 AM, Wolfgang Nothdurft wrote: > It seems that the ip6_route_output(net, sk, fl6) kernel function ignores > the fl6.flowi6_oif parameter for the routing decision. It is considered, but a mismatch is not considered fatal. I think the attached should fix your problem. diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 118f8fa1a809..cc52458f7226 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -1169,7 +1169,8 @@ struct dst_entry *ip6_route_output(struct net *net, const struct sock *sk, fl6->flowi6_iif = LOOPBACK_IFINDEX; - if ((sk && sk->sk_bound_dev_if) || rt6_need_strict(&fl6->daddr)) + if ((sk && sk->sk_bound_dev_if) || rt6_need_strict(&fl6->daddr) || + fl6->flowi6_oif) flags |= RT6_LOOKUP_F_IFACE; if (!ipv6_addr_any(&fl6->saddr))