Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp263497rdb; Mon, 22 Jan 2024 20:59:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IHvnm/z3BPxvhA/3GTBVjFpDMeFslztcdNmn0rxzRLrXbD+FFnRfc4eY/i5ayvJ+S337zwX X-Received: by 2002:a05:620a:bca:b0:783:1491:49ca with SMTP id s10-20020a05620a0bca00b00783149149camr9525319qki.28.1705985975247; Mon, 22 Jan 2024 20:59:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705985975; cv=pass; d=google.com; s=arc-20160816; b=B6MybRUVtKg5F91d2q9QRmwoCLBuqZT95/f1Xj55s1IThPaQf5w5BOVcU2ma+XvfW+ fD3iv7qBLVXJCmEs0PIzJmiPRgiHJnPXbGbtc2o578FM8m9WJn1XqSWvLRDL33wvjcsz QnzzU9e82YJn1hMwqnFXEaeYesTru4NOaqu8Oi8/TgUGBsBUUuy3YU0grDkVV0Izlk+0 USj9VdsvvSw4P+0db/7ZvfsnqYZ8AqF5HOr0xeT1CX68ZL/1Jf/WBrtJOGV9I5vRMgFP RFkivFyCx0X40tSUcrqlKIMwDgnWNv6ID+3o67epqOFIey6yrLfjHKqLGxQ7mctBslN1 6DYw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=80fDUlsPcEj+egMQLzVflkr6i7tgjwKWLsvUXBBer+c=; fh=D46yTgNZ7IgpzSa/mSu5OTjaHKIkZmswxPVCxck/kRk=; b=GP2Gfks6WbsGzxPXzjvSty9zOhA/8CcFDHcxws0oev66vtwCdLRUKl7wv4LqhITI+d Lo5wg5aCgrPEdl2tMtGV7MBCGTnj8lX/wHpTWtIaBEHx99R1VRBGXvtjAAN8hW7qUZaC yXZxQOerSvkW1I09ScDr0Ivlr1qUCoRzFnwfy50aiAiM/fHlWR8AatYvL2eP2h3Hnuyk dgDLYpBAVis4CwfQzWDcQlM8hWbFPmvbssvUqIc/qH71NrOs62bg9ORwaoDSIv00NIg2 C6QjpRh5nCZV4aAV0OrCD7kTgogZh6b4YeDm24E92g23MEaTFS5XE1z9Rwpie/i49oJh nK9A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AddHfXIH; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-34714-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34714-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id l9-20020a37f509000000b00783139dd015si6968320qkk.604.2024.01.22.20.59.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 20:59:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-34714-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AddHfXIH; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-34714-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34714-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 046FB1C231C6 for ; Tue, 23 Jan 2024 04:59:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 962CD2116; Tue, 23 Jan 2024 04:59:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AddHfXIH" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD4284400; Tue, 23 Jan 2024 04:59:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705985964; cv=none; b=NImqozgvRPC6gCIn8XFWMrQ9+0/oJb20iiSmmaCoALBeB5O6KVUK6lpklwnPLLffrhJDfCvh0D5k7E9qN5rAGzO5EEJOdz13uZSb4xQjhB/CzmV71dt97/vXmzVscYmPIgctk1RFxwxz9zaBwwL8Hreoh23Qgue6lOeny5Mtz0Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705985964; c=relaxed/simple; bh=ApZQ9VoLyfXDpKyhqM+8FaPkC3Zfhdt/ukiSEDuybXg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=pcNJq/+ZQc4aEBGkDnnhLPnYEdGR+FnyODekleEvc5cLqICzNBm2Z7MeSPM/271OMAbK+cKgy/LWXTmOvhlNAvKTgsNWp3lz9pAq0AZRsgO+9tilXEUW8ntjSBeIwMqV8siWQ2U9NyHFl3XwcG8wd4BT5irikTKwd9uqTguEmX0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AddHfXIH; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BA8E9C433C7; Tue, 23 Jan 2024 04:59:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705985964; bh=ApZQ9VoLyfXDpKyhqM+8FaPkC3Zfhdt/ukiSEDuybXg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=AddHfXIHlhBKJqgtXct057VQxQH0SC/J77m29Z74Pdz5fXxwCojt5MpJvbLmU8N15 8YbnP4W4RhRraViNliJYTojC7/pDT1Po0a5T8Az9VBa/+RD6j+SaqJ/otikqxigRxp ahoFANc5O06G7uGs2l923mcWl9OrFPBgaCTpaHFqtFLNAxn8IO6UUF8pisOdP8ZEU2 J0fHn0psL/TT2gcEx7IgPXrmjt5Jf8pnN1y1NmTR2mqZ9ZKg/KkvVqGOaKx58cJmQ4 wCJIdV/2U247mKtXfX7AW8dreFRnLxk/7loNzNqwl5ZjzwLZcRU/+YbrwwU07VnFiT OOUgBtCpee61Q== Message-ID: <0e12d8a0-4ef8-4b22-bc61-072247df47a7@kernel.org> Date: Mon, 22 Jan 2024 21:59:22 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [Discuss]iproute2: ipv6 route add fail Content-Language: en-US To: gaoxingwang , edumazet@google.com Cc: davem@davemloft.net, liaichun@huawei.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, yanan@huawei.com, yoshfuji@linux-ipv6.org References: <20240123030813.2493801-1-gaoxingwang1@huawei.com> From: David Ahern In-Reply-To: <20240123030813.2493801-1-gaoxingwang1@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 1/22/24 8:08 PM, gaoxingwang wrote: >>> Hello everyone, >>> >>> Here is a particular problem with routing. >>> Sometimes users can run the ip -6 route command to add a route whose destination address is the same as the gateway address, and it can be successfully added. However, adding another route with the same gateway address will fail later. >>> >>> Example: >>> # ip -6 route add 2409:8080:5a0a:60c7::7/128 via 2409:8080:5a0a:60c7::7 dev eth2 I missed that this is a self-referencing route. This one really should fail because it adds itself as a gateway. >>> # ip -6 route add 2409:8080:5a0a:60c7::8/128 via 2409:8080:5a0a:60c7::7 dev eth2 >>> RTNETLINK answers: No route to host and this one fails because of the above self referencing route; see ip6_route_check_nh: err = ip6_nh_lookup_table(net, cfg, gw_addr, cfg->fc_table, flags, &res); /* gw_addr can not require a gateway or resolve to a reject * route. If a device is given, it must match the result. */ >>> >>> Does the kernel not support this application scenario? you need to remove the host route that adds a gateway as itself