Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2977930pxm; Mon, 28 Feb 2022 09:36:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJw91961qiD2isFWPYpK30njx4mmGyhJFPFOaeVlk6jdJB5/vXdhWZxRLhk+be3ZwKM88kjd X-Received: by 2002:a17:902:bf07:b0:14f:a3a7:97a0 with SMTP id bi7-20020a170902bf0700b0014fa3a797a0mr21617318plb.105.1646069784149; Mon, 28 Feb 2022 09:36:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646069784; cv=none; d=google.com; s=arc-20160816; b=kgTbkANDZ2XJJe6iPM81CQ1xA7+HA7bG0ZBCV3HWyEldcqePjUQ8AT952KSplt6z8e RUFUswJFW2YLwgx3SX6dZJDOTQGSQ0JAqd8anCgkjgdnUdaPkWYjH3uC2Gw5FFvLLcai DaV+J3aEs8UUFo9dCwvZE1OCUhXzTOc69Mn22wE499YPhBE74q4RX4mSsd71eLD56k7B 45suTW/T5NYw78olIq85gfcEGqRUrKJdnkkhCznL6Aw7yRfhCkISWAKYR7DrRmy3r4Fu qtJzdaoD2tCaztfm87kdxp607pYxRIH6W57z1wagUECqRRJ3GUyqTwVsA9JtpPWYHR9f uMkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:organization :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fCS8NJ1f4o3pcOzQ2HFVShBXhNj/eZkbyzRnMyoDoqM=; b=U7k7elAQ+TWiVM5ye0O+JwTC+TTPfMY81RZItbXgnTPh7uxnpBnrF/ZF0X/O1dJXsQ KU7F5qr1iBnIaceyVYm5sZFzgkuQSFAfXvMR4oTIgMuam4248xXhI594Vq2k9EjUHnFv 8scKI4qj3ljZRlMAxH92kpgJ1hscFUOj6arc9eQIgofEJGSDwbJa19OXGmPj0CdYIFoT sQ9voXb9oyYIxZy17bqFb06iO00Kbvv6dQQs/0tTfJkYqJ9/ZlAbtZKCwfaviuk5x9jM +Eo1vEDWgsMYKOGKrp1Wihm0Gbn2Z8TzEHnhY17wccjMCGcdxlOTeOKX4LCXIt0dBONb gXxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=iQuNR3RT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 35-20020a17090a09a600b001bcba20f850si4399pjo.180.2022.02.28.09.36.08; Mon, 28 Feb 2022 09:36:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=iQuNR3RT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235155AbiB1NiM (ORCPT + 99 others); Mon, 28 Feb 2022 08:38:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235794AbiB1Nht (ORCPT ); Mon, 28 Feb 2022 08:37:49 -0500 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9366C7B57A; Mon, 28 Feb 2022 05:37:10 -0800 (PST) Received: by mail-lf1-x12b.google.com with SMTP id j7so21389365lfu.6; Mon, 28 Feb 2022 05:37:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:organization:content-transfer-encoding; bh=fCS8NJ1f4o3pcOzQ2HFVShBXhNj/eZkbyzRnMyoDoqM=; b=iQuNR3RTtSq4bagn13GPmxueF5CMO2/LAduE5LAjkj7bMEhGCrfeoQo8Xydc0cPJsr TL/nDl0eIb5cpSBsuWgBN4Aobnt6tNTKvsAyyG77OOmMXwwdOtPgPEHm+MJt1czGsWFW rG/5S3k9KKST1UBfMDCtNn0nbQXVJb8owaunrEt/M8v9r0SnIT0UygB354Fq740Ko6Hc IuutkNM1pkvl8H1XQyaquq93wOSO28j+TV2ba33Ej8qDtOaQKgPjvXgxD+/I9JMkDZl8 6BCYGmmXjrKGM74CB5E5TPbpKK4oP5vu8DMRY9CD5HYZAE6dmtgQ2EWsNQKTiGR1bH5o lFFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:organization:content-transfer-encoding; bh=fCS8NJ1f4o3pcOzQ2HFVShBXhNj/eZkbyzRnMyoDoqM=; b=cvWPA/hlfB0gi+KSF/5qV+nc8aO77A0tudiZLoBAdJvvJVnYTbjpwHHyQFEUFIjGHX +l+16ZcfGwwvpiSDT6YUVU5JvgoPV6MM8TEKzqIV0Ol/YH8HL5IMgttGfTN0InrAZQIa 7nlcP7pINKAkgJT20vDsxGdAnKDrq/Y+b112Vegz8E9xJI3BJaNxWgGBufSwq+u3ylhN kwPM+ATkN9YNb/2dLqtjrsAVIPFaWbi8a/h8TnXtkYE8oIuKaK2UCh140tVF0HMFbxfN KdVtA8R6PxhPOir3FDuXHietZx58MRIZO32zIgaHD+U9KJ9NsTuaIkFWdqIs2YNNCsYB ZKwQ== X-Gm-Message-State: AOAM532VmvkfQ7raCMZcuaiVdBAZtNlFgxWxjwco++8nO9zYy9sODPVf VF3izc7XQMbv9qSurxDTcgs= X-Received: by 2002:a05:6512:22cb:b0:42e:f15f:7282 with SMTP id g11-20020a05651222cb00b0042ef15f7282mr12911915lfu.530.1646055428992; Mon, 28 Feb 2022 05:37:08 -0800 (PST) Received: from wse-c0127.beijerelectronics.com ([208.127.141.29]) by smtp.gmail.com with ESMTPSA id i16-20020a2e5410000000b0024647722a4asm1326640ljb.29.2022.02.28.05.37.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 05:37:08 -0800 (PST) From: Hans Schultz X-Google-Original-From: Hans Schultz To: davem@davemloft.net, kuba@kernel.org Cc: netdev@vger.kernel.org, Hans Schultz , Stephen Hemminger , 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 Message-Id: <20220228133650.31358-3-schultz.hans+netdev@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220228133650.31358-1-schultz.hans+netdev@gmail.com> References: <20220228133650.31358-1-schultz.hans+netdev@gmail.com> MIME-Version: 1.0 Organization: Westermo Network Technologies AB Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Syntax: ip link set dev DEV type bridge_slave locked {on | off} Signed-off-by: Hans Schultz --- 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