From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: iproute2 - modifying routes in place Date: Mon, 14 May 2018 12:49:38 -0600 Message-ID: <7b4fac83-210f-2e91-5e56-6a381bd2a5ba@gmail.com> References: <07d96b60-68e5-8c20-8505-3df9178f9f78@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: Ryan Whelan Return-path: Received: from mail-pf0-f194.google.com ([209.85.192.194]:42949 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751941AbeENStm (ORCPT ); Mon, 14 May 2018 14:49:42 -0400 Received: by mail-pf0-f194.google.com with SMTP id p14-v6so6440785pfh.9 for ; Mon, 14 May 2018 11:49:42 -0700 (PDT) In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 5/14/18 12:40 PM, Ryan Whelan wrote: > Same behavior: > > > root@rwhelan-linux ~ > # ip -6 route > ::1 dev lo proto kernel metric 256 pref medium > fd9b:caee:ff93:ceef:3431:3831:3930:3031 dev internal0 proto kernel metric > 256 pref medium > fd9b:caee:ff93:ceef:3431:3831:3930:3032 dev internal0 src > fd9b:caee:ff93:ceef:3431:3831:3930:3031 metric 1024 pref medium > fe80::/64 dev enp0s3 proto kernel metric 256 pref medium > fe80::/64 dev enp0s8 proto kernel metric 256 pref medium > fe80::/64 dev internal0 proto kernel metric 256 pref medium > > root@rwhelan-linux ~ > # ip -6 route change fd9b:caee:ff93:ceef:3431:3831:3930:3032 dev internal0 > src fd9b:caee:ff93:ceef:3431:3831:3930:3031 metric 10 > RTNETLINK answers: No such file or directory 'change' only sets NLM_F_REPLACE. Since NLM_F_CREATE is not set ('ip ro replace') it does not add a new route and expects one to exist. Your table above shows the prefix with metric 256 not metric 10 so the route does not match. You should be seeing a message in dmesg to this effect. > > root@rwhelan-linux ~ > # ip -6 route replace fd9b:caee:ff93:ceef:3431:3831:3930:3032 dev internal0 > src fd9b:caee:ff93:ceef:3431:3831:3930:3031 metric 10 Adds a new entry because of NLM_F_CREATE. > > root@rwhelan-linux ~ > # ip -6 route > ::1 dev lo proto kernel metric 256 pref medium > fd9b:caee:ff93:ceef:3431:3831:3930:3031 dev internal0 proto kernel metric > 256 pref medium > fd9b:caee:ff93:ceef:3431:3831:3930:3032 dev internal0 src > fd9b:caee:ff93:ceef:3431:3831:3930:3031 metric 10 pref medium > fd9b:caee:ff93:ceef:3431:3831:3930:3032 dev internal0 src > fd9b:caee:ff93:ceef:3431:3831:3930:3031 metric 1024 pref medium > fe80::/64 dev enp0s3 proto kernel metric 256 pref medium > fe80::/64 dev enp0s8 proto kernel metric 256 pref medium > fe80::/64 dev internal0 proto kernel metric 256 pref medium > > root@rwhelan-linux ~ > # uname -a > Linux rwhelan-linux 4.17.0-rc3-ipv6-route-bugs+ #2 SMP Mon May 14 11:30:38 > EDT 2018 x86_64 x86_64 x86_64 GNU/Linux > On Sat, May 12, 2018 at 1:01 PM David Ahern wrote: > >> On 5/11/18 4:42 AM, Ryan Whelan wrote: >>> `ip route` has 2 subcommands that don't seem to work as expected and i'm >>> not sure if its a bug, or if i'm misunderstanding the semantics. > >> Can you try with ipv6/route-bugs branch in >> https://github.com/dsahern/linux