Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp668393ybz; Wed, 22 Apr 2020 05:53:28 -0700 (PDT) X-Google-Smtp-Source: APiQypIh4uwWzu8OuxTwqS2juAcAK4npwlfoNW6c1zhW+XhMD4psOZj1MamwXRBC816yZPiQK19+ X-Received: by 2002:a17:906:9706:: with SMTP id k6mr26597541ejx.103.1587560008275; Wed, 22 Apr 2020 05:53:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587560008; cv=none; d=google.com; s=arc-20160816; b=cw/kgDkXQ9qIV3q8vZQy0c1HSVdkfLbr3jHw3j7/zn/XLumWVCIYHdULszcqUKrmyB fC8EHfJhDvRghUHm3pEd1gkRRL9vt9nBLD+WvoXNTGL+EVCh8+0BZHgx1Na/0GFwAKcL c05f4TGtWn8OSr8M5rd0JW9ZCb0Qqp3wB6X/KamXc+c3HfPAVIZKu8m9HyjqEKDHip+0 UVfd2MyAdsK9UL/1FmqhEFZvkZGD5Sc9033xqI0alysG3FZjbDj2JUDL6Wj6Hk4wch7F jW8+mEg5bDPO+OVlKKbd/uxElI5rP+clYhR9OhVNROawhKa24OdhaTtlXGa3drnhK3ze 8DzA== 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=PMLEp4eJqmqyD+q33uMQS02AAs/tQYXXNM3aQjH8W84=; b=xAvMl8FhNAcPXlc2WHlOFSjw+FbTZ0FE4dPLRhtvJ1pThbZGIsMcKuXa7OzkVv9FUI Pay6Ztj9xKlI4Xma5ONeUnpB94kGYdKvThtVxNcnNp/svjcMLX2XEYuZax5CQpRgyTqF 4s1dvmtW5y4pyNBpxAm1WPcXWAr9RZVPkpPJn2bH84dCfTtxNxm76ZFJ61zsLIr6l7Uy Y7DuGoVstt4qUqpvmo+dviHnSoxES7wctH6KnlkCYk+L430DFcQR9rC+bItJ7mp6Vb8g IBp5OPGExfJsbE6wNnU0Rd7WVRnvcqhJxQubIPkz7+gg9pFMO+8SRXuvjLh7QDKnbEGE sxtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qQ9Kyerj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oc19si3664531ejb.487.2020.04.22.05.53.05; Wed, 22 Apr 2020 05:53:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qQ9Kyerj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732342AbgDVLBZ (ORCPT + 99 others); Wed, 22 Apr 2020 07:01:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:49402 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726762AbgDVKBM (ORCPT ); Wed, 22 Apr 2020 06:01:12 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 C7BA52076C; Wed, 22 Apr 2020 10:01:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587549672; bh=kB0zo3lBetf32IQvgyhg8RPLDDwuy69y9bOMl2+zrh8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qQ9KyerjEKa65IqufONB93QG3eJosn5pNBe+pk6o09BZ4gKKmZ88JuNHBAY4ySZRZ rleB34kFebVKEQuQJoH8vmuANARz39OXM7xcQjLNCHtwGolws1cw22YDNU2VmGn5A8 TqGZGFzpm5AVqA7loZEbAk1BgP5rqG/eenTeeRKY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tim Stallard , "David S. Miller" Subject: [PATCH 4.4 057/100] net: ipv6: do not consider routes via gateways for anycast address check Date: Wed, 22 Apr 2020 11:56:27 +0200 Message-Id: <20200422095033.383951683@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200422095022.476101261@linuxfoundation.org> References: <20200422095022.476101261@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Tim Stallard [ Upstream commit 03e2a984b6165621f287fadf5f4b5cd8b58dcaba ] The behaviour for what is considered an anycast address changed in commit 45e4fd26683c ("ipv6: Only create RTF_CACHE routes after encountering pmtu exception"). This now considers the first address in a subnet where there is a route via a gateway to be an anycast address. This breaks path MTU discovery and traceroutes when a host in a remote network uses the address at the start of a prefix (eg 2600:: advertised as 2600::/48 in the DFZ) as ICMP errors will not be sent to anycast addresses. This patch excludes any routes with a gateway, or via point to point links, like the behaviour previously from rt6_is_gw_or_nonexthop in net/ipv6/route.c. This can be tested with: ip link add v1 type veth peer name v2 ip netns add test ip netns exec test ip link set lo up ip link set v2 netns test ip link set v1 up ip netns exec test ip link set v2 up ip addr add 2001:db8::1/64 dev v1 nodad ip addr add 2001:db8:100:: dev lo nodad ip netns exec test ip addr add 2001:db8::2/64 dev v2 nodad ip netns exec test ip route add unreachable 2001:db8:1::1 ip netns exec test ip route add 2001:db8:100::/64 via 2001:db8::1 ip netns exec test sysctl net.ipv6.conf.all.forwarding=1 ip route add 2001:db8:1::1 via 2001:db8::2 ping -I 2001:db8::1 2001:db8:1::1 -c1 ping -I 2001:db8:100:: 2001:db8:1::1 -c1 ip addr delete 2001:db8:100:: dev lo ip netns delete test Currently the first ping will get back a destination unreachable ICMP error, but the second will never get a response, with "icmp6_send: acast source" logged. After this patch, both get destination unreachable ICMP replies. Fixes: 45e4fd26683c ("ipv6: Only create RTF_CACHE routes after encountering pmtu exception") Signed-off-by: Tim Stallard Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- include/net/ip6_route.h | 1 + 1 file changed, 1 insertion(+) --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h @@ -171,6 +171,7 @@ static inline bool ipv6_anycast_destinat return rt->rt6i_flags & RTF_ANYCAST || (rt->rt6i_dst.plen != 128 && + !(rt->rt6i_flags & (RTF_GATEWAY | RTF_NONEXTHOP)) && ipv6_addr_equal(&rt->rt6i_dst.addr, daddr)); }