From: Hans Schultz Date: Mon, 28 Feb 2022 13:36:48 +0000 (+0100) Subject: ip: iplink_bridge_slave: add locked port flag support X-Git-Tag: v5.18.0~38^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=092af16b7eedb651282b288aa6fa7bdfaa01d588;p=thirdparty%2Fiproute2.git ip: iplink_bridge_slave: add locked port flag support Syntax: ip link set dev DEV type bridge_slave locked {on | off} Signed-off-by: Hans Schultz Signed-off-by: David Ahern --- diff --git a/ip/iplink_bridge_slave.c b/ip/iplink_bridge_slave.c index 717875864..da14a95eb 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;