netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Daniel Borkmann <daniel@iogearbox.net>
Cc: razor@blackwall.org, martin.lau@kernel.org, dsahern@kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH iproute2 v2] ip, link: Add support for netkit
Date: Mon, 20 Nov 2023 13:30:37 -0800	[thread overview]
Message-ID: <20231120133037.7b86ec78@hermes.local> (raw)
In-Reply-To: <20231120211054.8750-1-daniel@iogearbox.net>

On Mon, 20 Nov 2023 22:10:54 +0100
Daniel Borkmann <daniel@iogearbox.net> wrote:

> +static void netkit_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
> +{
> +	if (!tb)
> +		return;
> +	if (tb[IFLA_NETKIT_MODE]) {
> +		__u32 mode = rta_getattr_u32(tb[IFLA_NETKIT_MODE]);
> +
> +		print_string(PRINT_ANY, "mode", "mode %s ",
> +			     netkit_mode_strings[mode]);

What if kernel adds a new mode in future?
Probably want something like:

		print_string(PRINT_ANY, "mode", "mode %s ",
			mode >= ARRAY_SIZE(netkit_mode_strings) ? "UNKNOWN" : netkit_mode_strings[mode]);

  parent reply	other threads:[~2023-11-20 21:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-20 21:10 [PATCH iproute2 v2] ip, link: Add support for netkit Daniel Borkmann
2023-11-20 21:16 ` Nikolay Aleksandrov
2023-11-20 21:30 ` Stephen Hemminger [this message]
2023-11-20 21:40   ` David Ahern
2023-11-20 22:05     ` Daniel Borkmann

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=20231120133037.7b86ec78@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=daniel@iogearbox.net \
    --cc=dsahern@kernel.org \
    --cc=martin.lau@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=razor@blackwall.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).