[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <acff5b79-2e5d-2877-0532-bb48608cc83b@gmail.com>
Date: Tue, 11 Jan 2022 09:35:05 -0700
From: David Ahern <dsahern@...il.com>
To: Anton Danilov <littlesmilingcloud@...il.com>,
Stephen Hemminger <stephen@...workplumber.org>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH iproute2 v2] ip: Extend filter links/addresses
On 1/8/22 12:58 PM, Anton Danilov wrote:
> @@ -227,6 +227,28 @@ static int match_link_kind(struct rtattr **tb, const char *kind, bool slave)
> return strcmp(parse_link_kind(tb[IFLA_LINKINFO], slave), kind);
> }
>
> +static int match_if_type_name(unsigned short if_type, const char *type_name)
> +{
> +
> + char *expected_type_name;
> +
> + switch (if_type) {
> + case ARPHRD_ETHER:
> + expected_type_name = "ether";
> + break;
> + case ARPHRD_LOOPBACK:
> + expected_type_name = "loopback";
> + break;
> + case ARPHRD_PPP:
> + expected_type_name = "ppp";
> + break;
> + default:
> + expected_type_name = "";
> + }
> +
> + return !strcmp(type_name, expected_type_name);
current 'type' filtering is the 'kind' string in the rtnl_link_ops --
bridge, veth, vlan, vrf, etc. You are now wanting to add 'exclude_type'
and make it based on hardware type. That is a confusing user api.
What type of interface filtering is motivating this change? e.g., link /
address lists but ignoring say vlan or veth devices?
Powered by blists - more mailing lists