Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp725520imm; Thu, 13 Sep 2018 06:53:21 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbCRctx9eaOFIgkmae4QN0Uzsa2xLpg8mSihRbrlzvI0G1TbkgH50gMuZRiP76nbvBr/4yA X-Received: by 2002:a63:d645:: with SMTP id d5-v6mr7335729pgj.450.1536846801768; Thu, 13 Sep 2018 06:53:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536846801; cv=none; d=google.com; s=arc-20160816; b=ZDqtO7KLsI2PZXq2B+4Hygt6nQjChDbXAFqGtkd+IflkMF/1IFLLOtpL9Hr5SyOQzi tiA4Gg237g75eHsAmu3xdR++x6vxqcoiCdqHdYUyszmzBJQBdozKlmWsT/RXNAG92WJB 6O/2Qbv/Hl8AnkfTaI+yaAf0nECUo4TTf/lUpif20Iccts6pxq+K3OfZi16l2w1S5A3u m3i9qeV9y2AVkAaTwIIge08BMphDEdzpFACyC0W7yBe1OQ1lq86gxTQ19pAYA/avPJKl ngWr9gZJt7gYXdjMmaEXQ8waras7M4pNj3EQTOub4/gtiAgdzhR93ACq/lWtgAlv4Ls9 rhwQ== 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; bh=X9CYtuJIp58i0NN/hrh+zKwyHXfGNzQgEicG5yLbDxs=; b=Al1T/sq+pqTXksKDL0qZIyOzmZmeoVRyRktgxWFPIdWCnMcLmNJOrAN3b3tw7l4mQN GtkfrVPQEa9iViJC1x+YBnfa6NJYUkHZ2Gv3rQkADUHOjO7wliufsFS13u9xQfx1IsKQ eNnwiS0CJzplCIl87nOJkDDCSs+nf+znUyu0O37pDZhf2BISJeNqApaYAslerQgmpoIK o4tUIEVZt/nonq04flUOBNlUsJj3yNcTTX8k2tE0hhaGzxBavMPsw9o52OpTstX6/ZPC PCKHCtW7qPJRhLQReFNWV0PuYYIfLIy5DeHuHeR/4mwjs9/zrO6ROUm3SUi94r7NcJXk Bs+g== ARC-Authentication-Results: i=1; mx.google.com; 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 y123-v6si4317848pfc.302.2018.09.13.06.53.07; Thu, 13 Sep 2018 06:53:21 -0700 (PDT) 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; 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 S1730838AbeIMTBH (ORCPT + 99 others); Thu, 13 Sep 2018 15:01:07 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33306 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730173AbeIMTBG (ORCPT ); Thu, 13 Sep 2018 15:01:06 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 83274D10; Thu, 13 Sep 2018 13:51:31 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jan Janssen , David Ahern , "David S. Miller" Subject: [PATCH 4.18 025/197] net/ipv6: Only update MTU metric if it set Date: Thu, 13 Sep 2018 15:29:34 +0200 Message-Id: <20180913131842.570694303@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180913131841.568116777@linuxfoundation.org> References: <20180913131841.568116777@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.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: David Ahern [ Upstream commit 15a81b418e22a9aa4a0504471fdcb0f4ebf69b96 ] Jan reported a regression after an update to 4.18.5. In this case ipv6 default route is setup by systemd-networkd based on data from an RA. The RA contains an MTU of 1492 which is used when the route is first inserted but then systemd-networkd pushes down updates to the default route without the mtu set. Prior to the change to fib6_info, metrics such as MTU were held in the dst_entry and rt6i_pmtu in rt6_info contained an update to the mtu if any. ip6_mtu would look at rt6i_pmtu first and use it if set. If not, the value from the metrics is used if it is set and finally falling back to the idev value. After the fib6_info change metrics are contained in the fib6_info struct and there is no equivalent to rt6i_pmtu. To maintain consistency with the old behavior the new code should only reset the MTU in the metrics if the route update has it set. Fixes: d4ead6b34b67 ("net/ipv6: move metrics from dst to rt6_info") Reported-by: Jan Janssen Signed-off-by: David Ahern Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv6/ip6_fib.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c @@ -987,7 +987,10 @@ static int fib6_add_rt2node(struct fib6_ fib6_clean_expires(iter); else fib6_set_expires(iter, rt->expires); - fib6_metric_set(iter, RTAX_MTU, rt->fib6_pmtu); + + if (rt->fib6_pmtu) + fib6_metric_set(iter, RTAX_MTU, + rt->fib6_pmtu); return -EEXIST; } /* If we have the same destination and the same metric,