From patchwork Fri Jul 6 12:59:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Georg Kohmann (geokohma)" X-Patchwork-Id: 940477 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=cisco.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=cisco.com header.i=@cisco.com header.b="lym73pMZ"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41MZnj5GMjz9s52 for ; Fri, 6 Jul 2018 23:09:45 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933370AbeGFNJn (ORCPT ); Fri, 6 Jul 2018 09:09:43 -0400 Received: from aer-iport-1.cisco.com ([173.38.203.51]:60146 "EHLO aer-iport-1.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932870AbeGFNJl (ORCPT ); Fri, 6 Jul 2018 09:09:41 -0400 X-Greylist: delayed 582 seconds by postgrey-1.27 at vger.kernel.org; Fri, 06 Jul 2018 09:09:40 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1840; q=dns/txt; s=iport; t=1530882581; x=1532092181; h=from:subject:to:message-id:date:mime-version: content-transfer-encoding; bh=qvkiJUWX7R16oqCvOeHcjjhTKHtjEj8vg9IgjDlz0BQ=; b=lym73pMZWVppIryp0yHUeTrdwuu0vz2EeYhAhsXJ6DWS84+og15wFmun otoIuVwEXcz0KaGfrmWzVHuiXEkHCuX2oFJNRiIFpjptwLW6y3jkx6dgg hpYgbP0b+r//4/Txpt96Y5tcO/4QPhSYYwltnjcbUSmZrv21z31w+biw0 g=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BzAQDM+T5b/xbLJq1cGQEBAQEBAQEBAQEBAQcBAQEBAYMfgXkSKIN6iGOjDYF6C4c8NhYBAgEBAgEBAm0ohWAECwEFWhwCJgJsBgIBAYMcgXMNjVyMZY5jgWkzhFuDdIE6gQuJOD+BDyeCOoRxgQSCNIJVAplPCY8cBoFAhAyCRoVFAYcQilQCBAsCEwGBSAgpgVIzGggbFYMkgiQXegEMjRI9MI0KgkgBAQ X-IronPort-AV: E=Sophos;i="5.51,316,1526342400"; d="scan'208";a="5008944" Received: from aer-iport-nat.cisco.com (HELO aer-core-3.cisco.com) ([173.38.203.22]) by aer-iport-1.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Jul 2018 12:59:57 +0000 Received: from [10.47.91.201] ([10.47.91.201]) (authenticated bits=0) by aer-core-3.cisco.com (8.14.5/8.14.5) with ESMTP id w66CxuC7012352 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 6 Jul 2018 12:59:57 GMT From: Georg Kohmann Subject: [PATCH] ipv6: icmp: Updating pmtu for link local route To: netdev@vger.kernel.org Message-ID: <52d524fe-5bc9-4c10-5ef1-9cae7ddb41ba@cisco.com> Date: Fri, 6 Jul 2018 14:59:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 Content-Language: en-US X-Authenticated-User: geokohma Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org When a ICMPV6_PKT_TOOBIG is received from a link local address the pmtu will be updated on a route with an arbitrary interface index. Subsequent packets sent back to the same link local address may therefore end up not considering the updated pmtu. Current behavior breaks TAHI v6LC4.1.4 Reduce PMTU On-link. Referring to RFC 1981: Section 3: "Note that Path MTU Discovery must be performed even in cases where a node "thinks" a destination is attached to the same link as itself. In a situation such as when a neighboring router acts as proxy [ND] for some destination, the destination can to appear to be directly connected but is in fact more than one hop away." Using the interface index from the incoming ICMPV6_PKT_TOOBIG when updating the pmtu. Signed-off-by: Georg Kohmann ---  net/ipv6/icmp.c | 2 +-  1 file changed, 1 insertion(+), 1 deletion(-)         else if (type == NDISC_REDIRECT)                 ip6_redirect(skb, net, skb->dev->ifindex, 0,                              sock_net_uid(net, NULL)); --- Tested on kernel 4.4.38. I am however worried that this patch may have consequences for other traffic on the same interface. Please advice or suggest at better approach. diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c index be491bf..7d0e9c7 100644 --- a/net/ipv6/icmp.c +++ b/net/ipv6/icmp.c @@ -92,7 +92,7 @@ static void icmpv6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,         struct net *net = dev_net(skb->dev);         if (type == ICMPV6_PKT_TOOBIG) -               ip6_update_pmtu(skb, net, info, 0, 0, sock_net_uid(net, NULL)); +               ip6_update_pmtu(skb, net, info, skb->dev->ifindex, 0, sock_net_uid(net, NULL));