From: Ido Schimmel <idosch@nvidia•com>
To: Hans Schultz <netdev@kapio-technology•com>
Cc: davem@davemloft•net, kuba@kernel•org, netdev@vger•kernel.org,
Florian Fainelli <f.fainelli@gmail•com>,
Andrew Lunn <andrew@lunn•ch>,
Vivien Didelot <vivien.didelot@gmail•com>,
Vladimir Oltean <olteanv@gmail•com>,
Eric Dumazet <edumazet@google•com>,
Paolo Abeni <pabeni@redhat•com>,
Kurt Kanzenbach <kurt@linutronix•de>,
Hauke Mehrtens <hauke@hauke-m•de>,
Woojung Huh <woojung.huh@microchip•com>,
UNGLinuxDriver@microchip•com, Sean Wang <sean.wang@mediatek•com>,
Landen Chao <Landen.Chao@mediatek•com>,
DENG Qingfang <dqfext@gmail•com>,
Matthias Brugger <matthias.bgg@gmail•com>,
Claudiu Manoil <claudiu.manoil@nxp•com>,
Alexandre Belloni <alexandre.belloni@bootlin•com>,
Jiri Pirko <jiri@resnulli•us>, Ivan Vecera <ivecera@redhat•com>,
Roopa Prabhu <roopa@nvidia•com>,
Nikolay Aleksandrov <razor@blackwall•org>,
Shuah Khan <shuah@kernel•org>,
Russell King <linux@armlinux•org.uk>,
Christian Marangi <ansuelsmth@gmail•com>,
Daniel Borkmann <daniel@iogearbox•net>,
Yuwei Wang <wangyuweihx@gmail•com>,
Petr Machata <petrm@nvidia•com>,
Florent Fourcot <florent.fourcot@wifirst•fr>,
Hans Schultz <schultz.hans@gmail•com>,
Joachim Wiberg <troglobit@gmail•com>,
Amit Cohen <amcohen@nvidia•com>,
linux-kernel@vger•kernel.org,
linux-arm-kernel@lists•infradead.org,
linux-mediatek@lists•infradead.org,
bridge@lists•linux-foundation.org,
linux-kselftest@vger•kernel.org
Subject: Re: [PATCH v2 iproute2-next 2/4] bridge: fdb: show locked FDB entries flag in output
Date: Thu, 13 Oct 2022 11:35:33 +0300 [thread overview]
Message-ID: <Y0fN1aYfNKS3JWFN@shredder> (raw)
In-Reply-To: <20221004152036.7848-2-netdev@kapio-technology.com>
On Tue, Oct 04, 2022 at 05:20:34PM +0200, Hans Schultz wrote:
> Signed-off-by: Hans Schultz <netdev@kapio-technology•com>
Don't leave the commit message empty. Explain the change and include an
example output showing the "locked" flag.
> ---
> bridge/fdb.c | 11 +++++++++--
Still missing a description of the "locked" flag from the man page.
Something like:
"
locked - this entry was added by the kernel in response to a host trying
to communicate behind a bridge port with MAB enabled. User space can
authenticate the host by clearing the flag. The flag cannot be set by
user space.
"
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/bridge/fdb.c b/bridge/fdb.c
> index 5f71bde0..f1f0a5bb 100644
> --- a/bridge/fdb.c
> +++ b/bridge/fdb.c
> @@ -93,7 +93,7 @@ static int state_a2n(unsigned int *s, const char *arg)
> return 0;
> }
>
> -static void fdb_print_flags(FILE *fp, unsigned int flags)
> +static void fdb_print_flags(FILE *fp, unsigned int flags, __u8 ext_flags)
s/__u8/__u32/
> {
> open_json_array(PRINT_JSON,
> is_json_context() ? "flags" : "");
> @@ -116,6 +116,9 @@ static void fdb_print_flags(FILE *fp, unsigned int flags)
> if (flags & NTF_STICKY)
> print_string(PRINT_ANY, NULL, "%s ", "sticky");
>
> + if (ext_flags & NTF_EXT_LOCKED)
> + print_string(PRINT_ANY, NULL, "%s ", "locked");
> +
> close_json_array(PRINT_JSON, NULL);
> }
>
> @@ -144,6 +147,7 @@ int print_fdb(struct nlmsghdr *n, void *arg)
> struct ndmsg *r = NLMSG_DATA(n);
> int len = n->nlmsg_len;
> struct rtattr *tb[NDA_MAX+1];
> + __u32 ext_flags = 0;
> __u16 vid = 0;
>
> if (n->nlmsg_type != RTM_NEWNEIGH && n->nlmsg_type != RTM_DELNEIGH) {
> @@ -170,6 +174,9 @@ int print_fdb(struct nlmsghdr *n, void *arg)
> parse_rtattr(tb, NDA_MAX, NDA_RTA(r),
> n->nlmsg_len - NLMSG_LENGTH(sizeof(*r)));
>
> + if (tb[NDA_FLAGS_EXT])
> + ext_flags = rta_getattr_u32(tb[NDA_FLAGS_EXT]);
> +
> if (tb[NDA_VLAN])
> vid = rta_getattr_u16(tb[NDA_VLAN]);
>
> @@ -266,7 +273,7 @@ int print_fdb(struct nlmsghdr *n, void *arg)
> if (show_stats && tb[NDA_CACHEINFO])
> fdb_print_stats(fp, RTA_DATA(tb[NDA_CACHEINFO]));
>
> - fdb_print_flags(fp, r->ndm_flags);
> + fdb_print_flags(fp, r->ndm_flags, ext_flags);
>
>
> if (tb[NDA_MASTER])
> --
> 2.34.1
>
next prev parent reply other threads:[~2022-10-13 8:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-04 15:20 [PATCH v2 iproute2-next 1/4] include: uapi: MacAuth and Blackhole feature header changes Hans Schultz
2022-10-04 15:20 ` [PATCH v2 iproute2-next 2/4] bridge: fdb: show locked FDB entries flag in output Hans Schultz
2022-10-13 8:35 ` Ido Schimmel [this message]
2022-10-04 15:20 ` [PATCH v2 iproute2-next 3/4] bridge: link: enable MacAuth/MAB feature Hans Schultz
2022-10-04 15:20 ` [PATCH v2 iproute2-next 4/4] bridge: fdb: enable FDB blackhole feature Hans Schultz
2022-10-13 8:44 ` Ido Schimmel
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=Y0fN1aYfNKS3JWFN@shredder \
--to=idosch@nvidia$(echo .)com \
--cc=Landen.Chao@mediatek$(echo .)com \
--cc=UNGLinuxDriver@microchip$(echo .)com \
--cc=alexandre.belloni@bootlin$(echo .)com \
--cc=amcohen@nvidia$(echo .)com \
--cc=andrew@lunn$(echo .)ch \
--cc=ansuelsmth@gmail$(echo .)com \
--cc=bridge@lists$(echo .)linux-foundation.org \
--cc=claudiu.manoil@nxp$(echo .)com \
--cc=daniel@iogearbox$(echo .)net \
--cc=davem@davemloft$(echo .)net \
--cc=dqfext@gmail$(echo .)com \
--cc=edumazet@google$(echo .)com \
--cc=f.fainelli@gmail$(echo .)com \
--cc=florent.fourcot@wifirst$(echo .)fr \
--cc=hauke@hauke-m$(echo .)de \
--cc=ivecera@redhat$(echo .)com \
--cc=jiri@resnulli$(echo .)us \
--cc=kuba@kernel$(echo .)org \
--cc=kurt@linutronix$(echo .)de \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-kselftest@vger$(echo .)kernel.org \
--cc=linux-mediatek@lists$(echo .)infradead.org \
--cc=linux@armlinux$(echo .)org.uk \
--cc=matthias.bgg@gmail$(echo .)com \
--cc=netdev@kapio-technology$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=olteanv@gmail$(echo .)com \
--cc=pabeni@redhat$(echo .)com \
--cc=petrm@nvidia$(echo .)com \
--cc=razor@blackwall$(echo .)org \
--cc=roopa@nvidia$(echo .)com \
--cc=schultz.hans@gmail$(echo .)com \
--cc=sean.wang@mediatek$(echo .)com \
--cc=shuah@kernel$(echo .)org \
--cc=troglobit@gmail$(echo .)com \
--cc=vivien.didelot@gmail$(echo .)com \
--cc=wangyuweihx@gmail$(echo .)com \
--cc=woojung.huh@microchip$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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