From: David Ahern <dsahern@gmail.com>
To: Anton Danilov <littlesmilingcloud@gmail.com>,
Stephen Hemminger <stephen@networkplumber.org>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH iproute2 v2] ip: Extend filter links/addresses
Date: Tue, 11 Jan 2022 09:35:05 -0700 [thread overview]
Message-ID: <acff5b79-2e5d-2877-0532-bb48608cc83b@gmail.com> (raw)
In-Reply-To: <20220108195824.23840-1-littlesmilingcloud@gmail.com>
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?
next prev parent reply other threads:[~2022-01-11 16:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-08 19:58 [PATCH iproute2 v2] ip: Extend filter links/addresses Anton Danilov
2022-01-11 16:35 ` David Ahern [this message]
2022-01-11 19:09 ` Anton Danilov
2022-01-12 17:57 ` David Ahern
-- strict thread matches above, loose matches on Subject: below --
2022-01-08 19:47 Антон Данилов
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=acff5b79-2e5d-2877-0532-bb48608cc83b@gmail.com \
--to=dsahern@gmail.com \
--cc=littlesmilingcloud@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).