Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2448410rwb; Thu, 29 Sep 2022 10:16:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6zEdIxLRouHU1BHITKp29TYYwGet/d3PKk8yLPj2JKFgsrXg0k7jQUQpwF+hTtH/9y+z4p X-Received: by 2002:a17:907:6d08:b0:787:9027:cb8d with SMTP id sa8-20020a1709076d0800b007879027cb8dmr3644866ejc.396.1664471791703; Thu, 29 Sep 2022 10:16:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664471791; cv=none; d=google.com; s=arc-20160816; b=YURJao2c17VrQu5HETIb3zp/vUZU6ZYvIsZrk127+IUJNVJQYD83n7LFe971MB2s0w YLNeYkQrVltxkelKkljXgeZrdu6rPg8iQx8P6JWy6GMq4IujFpJKkv72hi4mGPuw1Sng FRSgynM9gGS6XQVNta8v3mqUzH1P2NiNsxa+UXyz75ohJJ3vYZG7tTeKUNICcZ/zeXxi r44npMgudMjWWRK3mL9Cy0cjCd8beh+NCIzbm8Ge9c3qd7QHSe4XrVnEnZFV2Dm+aT6T Jt7zyGguNN9ujztucrwn5X5caBpKQCb78CQF1tRbBrjrDdFNiL917FnxpF8QACsALhg2 dJ0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:user-agent :references:in-reply-to:subject:cc:to:from:date:mime-version; bh=SP5PxlFHeHI8xF23gCChfbbg2QgpYBjF1gvYuvzkJcE=; b=T99awoo3gqbRFPHI74AMkTdZ+ilGmaxQgL9XNpIqCIsigU3v100dawI8hGCefyUu61 27APCRWJSaOFuFwH+nWBMwM6nmaZ63o6GAWatzLDrZY+Z2JKntAXeg1ngem9VeScl5ef sirifs+ytSC0Nno8sV0CKsrjwpgzw7TOsMPhADCFSzWKlVujIUDVSezVvN4LwJ7uaQIo CuThPKoGe/GxDcT4INwdYPmjH29exW3ZHBoTf8/HVThiTTtu8zLzSxDjSfrxPOgc5PMd agSKBahqwlRfkuO47B88Y5BGOLBw/lt/e12ERtRwrNeVmWwiANcbJG0r7oxpP4PvgL7V hAAQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 20-20020a508e14000000b004580bf860fasi43330edw.425.2022.09.29.10.15.36; Thu, 29 Sep 2022 10:16:31 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236069AbiI2QOb (ORCPT + 99 others); Thu, 29 Sep 2022 12:14:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236102AbiI2QOT (ORCPT ); Thu, 29 Sep 2022 12:14:19 -0400 Received: from mailout-taastrup.gigahost.dk (mailout-taastrup.gigahost.dk [46.183.139.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB5231DADE0; Thu, 29 Sep 2022 09:14:13 -0700 (PDT) Received: from mailout.gigahost.dk (mailout.gigahost.dk [89.186.169.112]) by mailout-taastrup.gigahost.dk (Postfix) with ESMTP id 462101884BA5; Thu, 29 Sep 2022 16:14:11 +0000 (UTC) Received: from smtp.gigahost.dk (smtp.gigahost.dk [89.186.169.109]) by mailout.gigahost.dk (Postfix) with ESMTP id 3F4F32500370; Thu, 29 Sep 2022 16:14:11 +0000 (UTC) Received: by smtp.gigahost.dk (Postfix, from userid 1000) id 34F409EC0002; Thu, 29 Sep 2022 16:14:11 +0000 (UTC) X-Screener-Id: 413d8c6ce5bf6eab4824d0abaab02863e8e3f662 MIME-Version: 1.0 Date: Thu, 29 Sep 2022 18:14:11 +0200 From: netdev@kapio-technology.com To: Stephen Hemminger Cc: davem@davemloft.net, kuba@kernel.org, Andrew Lunn , Alexandre Belloni , Nikolay Aleksandrov , Kurt Kanzenbach , Eric Dumazet , linux-kselftest@vger.kernel.org, Joachim Wiberg , Shuah Khan , Ivan Vecera , Florian Fainelli , Daniel Borkmann , Ido Schimmel , bridge@lists.linux-foundation.org, Russell King , linux-arm-kernel@lists.infradead.org, Roopa Prabhu , Paolo Abeni , Vivien Didelot , Woojung Huh , Landen Chao , Jiri Pirko , Amit Cohen , Christian Marangi , Hauke Mehrtens , Hans Schultz , Sean Wang , DENG Qingfang , Claudiu Manoil , linux-mediatek@lists.infradead.org, Matthias Brugger , Yuwei Wang , Petr Machata , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, UNGLinuxDriver@microchip.com, Vladimir Oltean , Florent Fourcot Subject: Re: [Bridge] [PATCH iproute2-next 2/2] bridge: fdb: enable FDB blackhole feature In-Reply-To: <20220929084312.2a216698@hermes.local> References: <20220929152137.167626-1-netdev@kapio-technology.com> <20220929152137.167626-2-netdev@kapio-technology.com> <20220929084312.2a216698@hermes.local> User-Agent: Gigahost Webmail Message-ID: <6de8a39832ebb15fc5e8c2f19e469514@kapio-technology.com> X-Sender: netdev@kapio-technology.com Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE 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 On 2022-09-29 17:43, Stephen Hemminger wrote: > On Thu, 29 Sep 2022 17:21:37 +0200 > Hans Schultz wrote: > >> >> @@ -493,6 +496,8 @@ static int fdb_modify(int cmd, int flags, int >> argc, char **argv) >> req.ndm.ndm_flags |= NTF_EXT_LEARNED; >> } else if (matches(*argv, "sticky") == 0) { >> req.ndm.ndm_flags |= NTF_STICKY; >> + } else if (matches(*argv, "blackhole") == 0) { >> + ext_flags |= NTF_EXT_BLACKHOLE; >> } else { >> if (strcmp(*argv, "to") == 0) >> NEXT_ARG(); > > The parsing of flags is weird here, most of the flags are compared with > strcmp() > but some use matches().. I should have used strcmp() all the time; but > at the > time did not realize what kind of confusion matches() can cause. Maybe just change all of them then, and then how about using strncmp() and maybe also strnlen() instead?