Netdev List
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Andy Roulin <aroulin@nvidia.com>
Cc: netdev@vger.kernel.org, dsahern@kernel.org,
	bridge@lists.linux.dev, razor@blackwall.org, nikolay@nvidia.com,
	idosch@nvidia.com, petrm@nvidia.com, danieller@nvidia.com
Subject: Re: [PATCH iproute2-next] iplink: bridge: add stp_mode support
Date: Mon, 18 May 2026 15:10:50 -0700	[thread overview]
Message-ID: <20260518151050.5dc637fd@phoenix.local> (raw)
In-Reply-To: <20260518163647.1935156-1-aroulin@nvidia.com>

On Mon, 18 May 2026 09:36:47 -0700
Andy Roulin <aroulin@nvidia.com> wrote:

> +		} else if (strcmp(*argv, "stp_mode") == 0) {
> +			__u32 stp_mode;
> +
> +			NEXT_ARG();
> +			if (strcmp(*argv, "auto") == 0)
> +				stp_mode = BR_STP_MODE_AUTO;
> +			else if (strcmp(*argv, "user") == 0)
> +				stp_mode = BR_STP_MODE_USER;
> +			else if (strcmp(*argv, "kernel") == 0)
> +				stp_mode = BR_STP_MODE_KERNEL;
> +			else if (get_u32(&stp_mode, *argv, 0))
> +				invarg("invalid stp_mode", *argv);
> +
> +			addattr32(n, 1024, IFLA_BR_STP_MODE, stp_mode);

Not your fault but yet another case where matches() was bad idea
because if you pass "stp" it matches only stp_state.

Really should fix all of iproute2 to use a table approach and
not allow conflicting matches, but that is a lot of work,
and will break peoples scripts.

      reply	other threads:[~2026-05-18 22:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-18 16:36 [PATCH iproute2-next] iplink: bridge: add stp_mode support Andy Roulin
2026-05-18 22:10 ` Stephen Hemminger [this message]

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=20260518151050.5dc637fd@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=aroulin@nvidia.com \
    --cc=bridge@lists.linux.dev \
    --cc=danieller@nvidia.com \
    --cc=dsahern@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@nvidia.com \
    --cc=petrm@nvidia.com \
    --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