Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5667362imu; Mon, 26 Nov 2018 03:47:29 -0800 (PST) X-Google-Smtp-Source: AFSGD/WdP838uE6Ae/X08nPtUo7Uspr6sKX+093DPVZ39b1EBL5OMkbHhZZvGdNHTfzjanuE7BEw X-Received: by 2002:a17:902:29ab:: with SMTP id h40mr27220237plb.238.1543232849312; Mon, 26 Nov 2018 03:47:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543232849; cv=none; d=google.com; s=arc-20160816; b=SdRQ4SbeC4BovCaDygb0owai1V4N/YCUINeSYJ0+oLET6XRVa6gDmIy/UYfukm5EwA SxED2mEgC2+bW9DBRvz+U8eqa/v7P6LhWaoRvkrdZQu9F4EfQKuYk1Tfw/KtWib3bAwy bRgUKF4iJRt8buRuEwS0mz0XbqAMLV49nzKycnckbbVqsG6WdnpeBA4yYnTv/oHZiBID Ujnj8gAyQMNYQE3ka68LxWtRaraGUz1rErnCBHYFN61Xiwy3tSJwCNxXdP4a5hRQN3/y sheYDfsbW2y4uuyMntI8zmttEEHW6FhnRbp8WBVvy/zu4iA7cfelUcfh2UBqKEh2J1t/ AQXQ== 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=99y2PijPjT6E0YWCa20vjZPEd0oHULWFdU/xlvjNmDA=; b=qRwhgr1F8sR7e2lWnVnqQ9tg/6/A4mYEBamfdl12I1umZkeZyrcQJTmuOZamx6dO9I OWj20ffQEpztseM+CMD9h6R8yQyz6ShgY5g/Gatv4ayz31yCK2qjolNXnBMIfsHws5LK rQw9SQJJKstPKcY8ikcKr6BHwzAEtb97VDdJbcXX+P76610WELtGw+V/gekHXb+gAtN3 rZUnEuqJkQYH9usvYgkRNYOPiklkEPxElx9YPwLiQUo5Hv6UQqPhHFETA6oGDMDqcAub pFwQrXkBtjyIm9qgT+3OUTAwQI1NfAm7C7CQ6De7JiL3LuJGAuOOwXk1oz3gmKhcKZbN Pmqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XkmmGVmI; 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 o3si68903pgi.388.2018.11.26.03.46.59; Mon, 26 Nov 2018 03:47:29 -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=XkmmGVmI; 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 S1728021AbeKZVtR (ORCPT + 99 others); Mon, 26 Nov 2018 16:49:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:58134 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726923AbeKZVtQ (ORCPT ); Mon, 26 Nov 2018 16:49:16 -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 B8E7320817; Mon, 26 Nov 2018 10:55:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543229732; bh=L4nQoftVq9Kk6fnH8UXEv+4SNZ10dIPxPjmY+nyZy1g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XkmmGVmIB5/PbeeXtTshviv6/rFuYffj5cNqgQmOgrnXCGvnse3U81Pg8/dQ09E5E MUkC2UbASLokiWSxp1rqt3v6vNZbrjfeyFSE08eVVsB5ML6QAAV0mNoGKrhj9fY6TN 9QYSfmvGVxtPJW1o9Fl56mM9idkm5sezveMxe5m0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Preethi Ramachandra , David Ahern , "David S. Miller" Subject: [PATCH 4.4 05/70] ipv6: Fix PMTU updates for UDP/raw sockets in presence of VRF Date: Mon, 26 Nov 2018 11:50:20 +0100 Message-Id: <20181126105047.456791259@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181126105046.722096341@linuxfoundation.org> References: <20181126105046.722096341@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: David Ahern [ Upstream commit 7ddacfa564870cdd97275fd87decb6174abc6380 ] Preethi reported that PMTU discovery for UDP/raw applications is not working in the presence of VRF when the socket is not bound to a device. The problem is that ip6_sk_update_pmtu does not consider the L3 domain of the skb device if the socket is not bound. Update the function to set oif to the L3 master device if relevant. Fixes: ca254490c8df ("net: Add VRF support to IPv6 stack") Reported-by: Preethi Ramachandra Signed-off-by: David Ahern Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv6/route.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -1420,8 +1420,12 @@ EXPORT_SYMBOL_GPL(ip6_update_pmtu); void ip6_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, __be32 mtu) { - ip6_update_pmtu(skb, sock_net(sk), mtu, - sk->sk_bound_dev_if, sk->sk_mark); + int oif = sk->sk_bound_dev_if; + + if (!oif && skb->dev) + oif = l3mdev_master_ifindex(skb->dev); + + ip6_update_pmtu(skb, sock_net(sk), mtu, oif, sk->sk_mark); } EXPORT_SYMBOL_GPL(ip6_sk_update_pmtu);