Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2021658imu; Fri, 14 Dec 2018 04:38:30 -0800 (PST) X-Google-Smtp-Source: AFSGD/U5wtpCfigIvstGLxx3emY/jLUC80xePlyrF5GVNv058/YRqoP8I/KVmzbrZRx8xSYvfDcZ X-Received: by 2002:a62:4641:: with SMTP id t62mr2646424pfa.141.1544791110604; Fri, 14 Dec 2018 04:38:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544791110; cv=none; d=google.com; s=arc-20160816; b=dXNagwlRT/UFyWKcMvQe+xO4KmtlIlVWNEuZKBq9/DBs3Qh1JL+tJ4KMsi/FZUf6Xe CARteGqkeD7GAKNVRZALApKuIDfJkY6KHKGQkYq4KXem1t5QQskQPQ5zLoPSIjipu0mx 0PElTVuc52ohr8GQm1vkT0FzA9eHiSgXD0NZPf4q6c8m4owhKuwJYkRjkQe3z5lTu/XF 3/QfHMHn+NeOXBDoigcYe0wUC+vdVTYbqzogdaaT706ZglfQ7dPX8kPlsmlEiAc50WvO lybhYuH5W53DZFzumg+QSM5/5Pt7apZw4kYW30SP9ndeuK28vWPbFc04zJ+AN0JFmVzO bVfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fxdUv0wAGKnbuPdRzCaarrykqy5LysbQ3lVqzSoaW8o=; b=g08zfDh+fGTBBARpuK520uInIdD4T+3LN0Yt4No3On+dxDKKvtEHAQG+NAFRzpExqq SfHRFDypdBTYtFNxC1soFIOs5IY7kzHpaqLn/4XfoFBRKaoTS/cuGC/0yGGsKr93XKX+ ynp28SqLP+5j0GZc9cZQIkhYL+rdAfEO/M0YrKWCDFqIILoNBnwvB1f+KHXxNXbYh8no 9oPspuDbDZ80ZoDd4SjeDCK4qNyQuJdr/tMWTWGytL+VCoz7NqkJvvN4RjuG3S8dBDEW b8DzitGGpXUIetyc0KFYbMCvlE1h2rf18lRecwWj3+L9XANe4wXj7JgFeUGOYGeunwVE xhbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=M3Lz+oFA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s4si4076805pfb.190.2018.12.14.04.38.15; Fri, 14 Dec 2018 04:38:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=M3Lz+oFA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730716AbeLNMh0 (ORCPT + 99 others); Fri, 14 Dec 2018 07:37:26 -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