From patchwork Tue Apr 21 23:48:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Ahern X-Patchwork-Id: 220819 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC698C2BA19 for ; Tue, 21 Apr 2020 23:48:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 82149206E9 for ; Tue, 21 Apr 2020 23:48:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587512910; bh=drjTTPR6qP+yRPTJ11BBmGTaQoQ6JtjmWXJMNdhAOnk=; h=From:To:Cc:Subject:Date:List-ID:From; b=lts3ywDwduVF5Qe/gWFXkFOYYGTxFI2NhDImNdS+odCRn9zPxSYANzygCpNjEs+YH rWqVZzngJVmgCCmlEG2NLeWTVwnlk0QJoYuHHwgabw5T14YXt1KENK2JlshVVOACWM 7jNzz6ku5N11OafR5zuZqI1g3GXEFbXAHlx3vu1E= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726100AbgDUXs3 (ORCPT ); Tue, 21 Apr 2020 19:48:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:52720 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725822AbgDUXs3 (ORCPT ); Tue, 21 Apr 2020 19:48:29 -0400 Received: from C02YQ0RWLVCF.internal.digitalocean.com (c-73-181-34-237.hsd1.co.comcast.net [73.181.34.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DCB5C2068F; Tue, 21 Apr 2020 23:48:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587512909; bh=drjTTPR6qP+yRPTJ11BBmGTaQoQ6JtjmWXJMNdhAOnk=; h=From:To:Cc:Subject:Date:From; b=pxFfscTOpj+70Uk242QdcqxUo2popTF5iHPrizj+ZJJQDsE8Ve3EwJIH9liwIa91T HQGcfNyKOEWHQD+d+uPVuO3aaQO8iepD842qpkkrzHZv6MsK0kyLE5/wwuXVMSHeFx vy+BBSVlGkLreHd8VC63u2giheAaruwYBlNMnsbc= From: David Ahern To: davem@davemloft.net, kuba@kernel.org Cc: netdev@vger.kernel.org, David Ahern Subject: [PATCH net] vrf: Fix IPv6 with qdisc and xfrm Date: Tue, 21 Apr 2020 17:48:27 -0600 Message-Id: <20200421234827.63465-1-dsahern@kernel.org> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: David Ahern When a qdisc is attached to the VRF device, the packet goes down the ndo xmit function which is setup to send the packet back to the VRF driver which does a lookup to send the packet out. The lookup in the VRF driver is not considering xfrm policies. Change it to use ip6_dst_lookup_flow rather than ip6_route_output. Fixes: 35402e313663 ("net: Add IPv6 support to VRF device") Signed-off-by: David Ahern --- drivers/net/vrf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c index 6f5d03b7d9c0..56f8aab46f89 100644 --- a/drivers/net/vrf.c +++ b/drivers/net/vrf.c @@ -188,8 +188,8 @@ static netdev_tx_t vrf_process_v6_outbound(struct sk_buff *skb, fl6.flowi6_proto = iph->nexthdr; fl6.flowi6_flags = FLOWI_FLAG_SKIP_NH_OIF; - dst = ip6_route_output(net, NULL, &fl6); - if (dst == dst_null) + dst = ip6_dst_lookup_flow(net, NULL, &fl6, NULL); + if (IS_ERR(dst) || dst == dst_null) goto err; skb_dst_drop(skb);