netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Benjamin Poirier <bpoirier@nvidia.com>
Cc: netdev@vger.kernel.org, David Ahern <dsahern@kernel.org>,
	Ido Schimmel <idosch@nvidia.com>
Subject: Re: [PATCH iproute2 1/4] bridge: Do not print stray prefixes in monitor mode
Date: Thu, 22 Sep 2022 08:28:54 -0700	[thread overview]
Message-ID: <20220922082854.5aa1bffe@hermes.local> (raw)
In-Reply-To: <20220922061938.202705-2-bpoirier@nvidia.com>

On Thu, 22 Sep 2022 15:19:35 +0900
Benjamin Poirier <bpoirier@nvidia.com> wrote:

> When using `bridge monitor` with the '-timestamp' option or the "all"
> parameter, prefixes are printed before the actual event descriptions.
> Currently, those prefixes are printed for each netlink message that's
> received. However, some netlink messages do not lead to an event
> description being printed. That's usually because a message is not related
> to AF_BRIDGE. This results in stray prefixes being printed.
> 
> Restructure accept_msg() and its callees such that prefixes are only
> printed after a message has been checked for eligibility.
> 
> The issue can be witnessed using the following commands:
> 	ip link add dummy0 type dummy
> 	# Start `bridge monitor all` now in another terminal.
> 	# Cause a stray "[LINK]" to be printed (family 10).
> 	# It does not appear yet because the output is line buffered.
> 	ip link set dev dummy0 up
> 	# Cause a stray "[NEIGH]" to be printed (family 2).
> 	ip neigh add 10.0.0.1 lladdr 02:00:00:00:00:01 dev dummy0
> 	# Cause a genuine entry to be printed, which flushes the previous
> 	# output.
> 	bridge fdb add 02:00:00:00:00:01 dev dummy0
> 	# We now see:
> 	# [LINK][NEIGH][NEIGH]02:00:00:00:00:01 dev dummy0 self permanent
> 
> Fixes: d04bc300c3e3 ("Add bridge command")
> Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
> ---

Looks good, reminds me that the bridge command need to be converted
to use json_print.

  reply	other threads:[~2022-09-22 15:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22  6:19 [PATCH iproute2 0/4] monitor command fixes Benjamin Poirier
2022-09-22  6:19 ` [PATCH iproute2 1/4] bridge: Do not print stray prefixes in monitor mode Benjamin Poirier
2022-09-22 15:28   ` Stephen Hemminger [this message]
2022-10-25 22:29     ` [PATCH iproute2] ip-monitor: Do not error out when RTNLGRP_STATS is not available Benjamin Poirier
2022-10-26  2:17       ` Stephen Hemminger
2022-10-26  3:20       ` Stephen Hemminger
2022-10-26  6:49         ` [PATCH iproute2 v2] " Benjamin Poirier
2022-09-22  6:19 ` [PATCH iproute2 2/4] ip-monitor: Do not listen for nexthops by default when specifying stats Benjamin Poirier
2022-09-22  6:19 ` [PATCH iproute2 3/4] ip-monitor: Include stats events in default and "all" cases Benjamin Poirier
2022-10-25 15:51   ` Stephen Hemminger
2022-09-22  6:19 ` [PATCH iproute2 4/4] ip-monitor: Fix the selection of rtnl groups when listening for all object types Benjamin Poirier

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=20220922082854.5aa1bffe@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=bpoirier@nvidia.com \
    --cc=dsahern@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).