From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH] iproute: "list/flush/save default" selected all of the routes Date: Tue, 19 Dec 2017 08:27:53 -0800 Message-ID: <20171219082753.4e271cf9@xeon-e3> References: <20171216132115.7d924d8d@xeon-e3> <1513508940-29430-1-git-send-email-green@msu.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: zubkov318@gmail.com, netdev@vger.kernel.org To: Alexander Zubkov Return-path: Received: from mail-pg0-f54.google.com ([74.125.83.54]:34193 "EHLO mail-pg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750763AbdLSQ14 (ORCPT ); Tue, 19 Dec 2017 11:27:56 -0500 Received: by mail-pg0-f54.google.com with SMTP id j4so10743027pgp.1 for ; Tue, 19 Dec 2017 08:27:56 -0800 (PST) In-Reply-To: <1513508940-29430-1-git-send-email-green@msu.ru> Sender: netdev-owner@vger.kernel.org List-ID: On Sun, 17 Dec 2017 12:09:00 +0100 Alexander Zubkov wrote: > When running "ip route list default" and not specifying address family, > one will get all of the routes instead of just default only. The same > is for "exact default" and "match default". > > It behaves in such a way because default route with unspecified family > has the same all-zeroes value like no prefix specified at all. Thus > following code blindly ignores the fact, that prefix was actually > specified. > > This patch adds the flag PREFIXLEN_SPECIFIED to the default route too. > And then checks its value when filtering routes. > > Signed-off-by: Alexander Zubkov Applied, thanks Alexander