netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans Schultz <schultz.hans@gmail.com>
To: davem@davemloft.net, kuba@kernel.org
Cc: netdev@vger.kernel.org,
	Hans Schultz <schultz.hans+netdev@gmail.com>,
	Stephen Hemminger <stephen@networkplumber.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH iproute2-next V2 2/4] ip: iplink_bridge_slave: add locked port flag support
Date: Mon, 28 Feb 2022 14:36:48 +0100	[thread overview]
Message-ID: <20220228133650.31358-3-schultz.hans+netdev@gmail.com> (raw)
In-Reply-To: <20220228133650.31358-1-schultz.hans+netdev@gmail.com>

Syntax: ip link set dev DEV type bridge_slave locked {on | off}

Signed-off-by: Hans Schultz <schultz.hans+netdev@gmail.com>
---
 ip/iplink_bridge_slave.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/ip/iplink_bridge_slave.c b/ip/iplink_bridge_slave.c
index 71787586..da14a95e 100644
--- a/ip/iplink_bridge_slave.c
+++ b/ip/iplink_bridge_slave.c
@@ -42,6 +42,7 @@ static void print_explain(FILE *f)
 		"			[ neigh_suppress {on | off} ]\n"
 		"			[ vlan_tunnel {on | off} ]\n"
 		"			[ isolated {on | off} ]\n"
+		"			[ locked {on | off} ]\n"
 		"			[ backup_port DEVICE ] [ nobackup_port ]\n"
 	);
 }
@@ -278,6 +279,10 @@ static void bridge_slave_print_opt(struct link_util *lu, FILE *f,
 		print_on_off(PRINT_ANY, "isolated", "isolated %s ",
 			     rta_getattr_u8(tb[IFLA_BRPORT_ISOLATED]));
 
+	if (tb[IFLA_BRPORT_LOCKED])
+		print_on_off(PRINT_ANY, "locked", "locked %s ",
+			     rta_getattr_u8(tb[IFLA_BRPORT_LOCKED]));
+
 	if (tb[IFLA_BRPORT_BACKUP_PORT]) {
 		int backup_p = rta_getattr_u32(tb[IFLA_BRPORT_BACKUP_PORT]);
 
@@ -393,6 +398,10 @@ static int bridge_slave_parse_opt(struct link_util *lu, int argc, char **argv,
 			NEXT_ARG();
 			bridge_slave_parse_on_off("isolated", *argv, n,
 						  IFLA_BRPORT_ISOLATED);
+		} else if (matches(*argv, "locked") == 0) {
+			NEXT_ARG();
+			bridge_slave_parse_on_off("locked", *argv, n,
+						  IFLA_BRPORT_LOCKED);
 		} else if (matches(*argv, "backup_port") == 0) {
 			int ifindex;
 
-- 
2.30.2


  parent reply	other threads:[~2022-02-28 13:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-28 13:36 [PATCH iproute2-next V2 0/4] Add support for locked bridge ports (for 802.1X) Hans Schultz
2022-02-28 13:36 ` [PATCH iproute2-next V2 1/4] bridge: link: add command to set port in locked mode Hans Schultz
2022-02-28 13:36 ` Hans Schultz [this message]
2022-02-28 13:36 ` [PATCH iproute2-next V2 3/4] man8/bridge.8: add locked port feature description and cmd syntax Hans Schultz
2022-02-28 13:36 ` [PATCH iproute2-next V2 4/4] man8/ip-link.8: " Hans Schultz
2022-03-04 16:20 ` [PATCH iproute2-next V2 0/4] Add support for locked bridge ports (for 802.1X) patchwork-bot+netdevbpf
2022-03-11  8:54 ` Hans Schultz

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=20220228133650.31358-3-schultz.hans+netdev@gmail.com \
    --to=schultz.hans@gmail.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=schultz.hans+netdev@gmail.com \
    --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).