From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,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 5967EC67839 for ; Fri, 14 Dec 2018 12:37:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1BF1521104 for ; Fri, 14 Dec 2018 12:37:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544791048; bh=u3p/muIl+Jzn/TfGpNIF6v/odYWTbmVTnpVdagjyXR0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=vd6CfQZm3Mn1aEZEG39yjN4M9/eaJfTND8qWYcl/jMZAlcCasUaahteqvuBBn14bs 84IdgwIKkQlhzn3BL3P1cwd2lCBxV98FJUVd1yg7xTsSeBnu7a5anyP3HaeneKD3Y3 JNvYOscQWrxnoPjvfvdK39yait8YHlYEwTkqtVRI= DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1BF1521104 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730730AbeLNMh1 (ORCPT ); Fri, 14 Dec 2018 07:37:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:51338 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730891AbeLNMGU (ORCPT ); Fri, 14 Dec 2018 07:06:20 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DD5EC2147D; Fri, 14 Dec 2018 12:06:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544789179; bh=u3p/muIl+Jzn/TfGpNIF6v/odYWTbmVTnpVdagjyXR0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M3Lz+oFAGgNUVIaKeARBH42KJbU9GwOcnDceqiYou98SVQ/RQD8MbAHGKuWAVWE6f FdvpJ0gbYT9ln6UjHMmCXSALwHmDlRS64QHiwN6a6gclPvxeYOaokblLSISTWNY++d h1yrqOjeXEWdpiCV2w0rAdDj5cHRLe4l/6VgrIcw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alin Nastac , Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 4.19 092/142] netfilter: ipv6: Preserve link scope traffic original oif Date: Fri, 14 Dec 2018 12:59:37 +0100 Message-Id: <20181214115750.732257753@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181214115747.053633987@linuxfoundation.org> References: <20181214115747.053633987@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 508b09046c0f21678652fb66fd1e9959d55591d2 ] When ip6_route_me_harder is invoked, it resets outgoing interface of: - link-local scoped packets sent by neighbor discovery - multicast packets sent by MLD host - multicast packets send by MLD proxy daemon that sets outgoing interface through IPV6_PKTINFO ipi6_ifindex Link-local and multicast packets must keep their original oif after ip6_route_me_harder is called. Signed-off-by: Alin Nastac Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- net/ipv6/netfilter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv6/netfilter.c b/net/ipv6/netfilter.c index 5ae8e1c51079..8b075f0bc351 100644 --- a/net/ipv6/netfilter.c +++ b/net/ipv6/netfilter.c @@ -24,7 +24,8 @@ int ip6_route_me_harder(struct net *net, struct sk_buff *skb) unsigned int hh_len; struct dst_entry *dst; struct flowi6 fl6 = { - .flowi6_oif = sk ? sk->sk_bound_dev_if : 0, + .flowi6_oif = sk && sk->sk_bound_dev_if ? sk->sk_bound_dev_if : + rt6_need_strict(&iph->daddr) ? skb_dst(skb)->dev->ifindex : 0, .flowi6_mark = skb->mark, .flowi6_uid = sock_net_uid(net, sk), .daddr = iph->daddr, -- 2.19.1