[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6de8a39832ebb15fc5e8c2f19e469514@kapio-technology.com>
Date: Thu, 29 Sep 2022 18:14:11 +0200
From: netdev@...io-technology.com
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: davem@...emloft.net, kuba@...nel.org, Andrew Lunn <andrew@...n.ch>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Nikolay Aleksandrov <razor@...ckwall.org>,
Kurt Kanzenbach <kurt@...utronix.de>,
Eric Dumazet <edumazet@...gle.com>,
linux-kselftest@...r.kernel.org,
Joachim Wiberg <troglobit@...il.com>,
Shuah Khan <shuah@...nel.org>,
Ivan Vecera <ivecera@...hat.com>,
Florian Fainelli <f.fainelli@...il.com>,
Daniel Borkmann <daniel@...earbox.net>,
Ido Schimmel <idosch@...dia.com>,
bridge@...ts.linux-foundation.org,
Russell King <linux@...linux.org.uk>,
linux-arm-kernel@...ts.infradead.org,
Roopa Prabhu <roopa@...dia.com>,
Paolo Abeni <pabeni@...hat.com>,
Vivien Didelot <vivien.didelot@...il.com>,
Woojung Huh <woojung.huh@...rochip.com>,
Landen Chao <Landen.Chao@...iatek.com>,
Jiri Pirko <jiri@...nulli.us>, Amit Cohen <amcohen@...dia.com>,
Christian Marangi <ansuelsmth@...il.com>,
Hauke Mehrtens <hauke@...ke-m.de>,
Hans Schultz <schultz.hans@...il.com>,
Sean Wang <sean.wang@...iatek.com>,
DENG Qingfang <dqfext@...il.com>,
Claudiu Manoil <claudiu.manoil@....com>,
linux-mediatek@...ts.infradead.org,
Matthias Brugger <matthias.bgg@...il.com>,
Yuwei Wang <wangyuweihx@...il.com>,
Petr Machata <petrm@...dia.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, UNGLinuxDriver@...rochip.com,
Vladimir Oltean <olteanv@...il.com>,
Florent Fourcot <florent.fourcot@...irst.fr>
Subject: Re: [Bridge] [PATCH iproute2-next 2/2] bridge: fdb: enable FDB
blackhole feature
On 2022-09-29 17:43, Stephen Hemminger wrote:
> On Thu, 29 Sep 2022 17:21:37 +0200
> Hans Schultz <netdev@...io-technology.com> 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?
Powered by blists - more mailing lists