All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@kernel.org>
To: Yuyang Huang <sigefriedhyy@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Donald Hunter <donald.hunter@gmail.com>,
	Eric Dumazet <edumazet@google.com>,
	Ido Schimmel <idosch@nvidia.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Kuniyuki Iwashima <kuniyu@google.com>,
	Nikolaos Gkarlis <nickgarlis@gmail.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Sabrina Dubroca <sd@queasysnail.net>,
	Shuah Khan <shuah@kernel.org>, Simon Horman <horms@kernel.org>,
	Stanislav Fomichev <sdf.kernel@gmail.com>,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next 1/3] rtnetlink: add AF_PACKET multicast dumps
Date: Tue, 8 Sep 2026 09:56:54 -0600	[thread overview]
Message-ID: <1673485d-5529-415b-b1b6-60e27291e3bf@kernel.org> (raw)
In-Reply-To: <20260905093932.43726-2-sigefriedhyy@gmail.com>

On 9/5/26 4:39 AM, Yuyang Huang wrote:
> +static int rtnl_dump_mcaddr(struct sk_buff *skb, struct netlink_callback *cb)
> +{
> +	struct net *net = sock_net(skb->sk);
> +	unsigned int flags = NLM_F_MULTI;
> +	struct {
> +		unsigned long ifindex;
> +		int addr_idx;
> +	} *ctx = (void *)cb->ctx;
> +	struct net_device *dev;
> +	int ifindex = 0;
> +	int err = 0;
> +
> +	if (cb->strict_check) {

this is new code. It should only work with strict checking.

> +		err = rtnl_valid_dump_mcaddr_req(cb->nlh, cb->extack,
> +						 &ifindex);
> +		if (err < 0)
> +			return err;
> +	}
> +
> +	rcu_read_lock();
> +
> +	if (ifindex) {
> +		cb->answer_flags |= NLM_F_DUMP_FILTERED;
> +		flags |= NLM_F_DUMP_FILTERED;
> +		dev = dev_get_by_index_rcu(net, ifindex);
> +		if (!dev) {
> +			err = -ENODEV;
> +			goto out;
> +		}
> +		err = rtnl_dump_mcaddr_dev(dev, skb, cb, &ctx->addr_idx, flags);
> +		goto out;
> +	}
> +
> +	for_each_netdev_dump(net, dev, ctx->ifindex) {
> +		err = rtnl_dump_mcaddr_dev(dev, skb, cb, &ctx->addr_idx,
> +					   flags);
> +		if (err < 0)
> +			break;
> +	}
> +out:
> +	rcu_read_unlock();
> +	return err;
> +}
> +
>  struct sk_buff *rtmsg_ifinfo_build_skb(int type, struct net_device *dev,
>  				       unsigned int change,
>  				       u32 event, gfp_t flags, int *new_nsid,


  reply	other threads:[~2026-09-08 15:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-05  9:39 [PATCH net-next 0/3] rtnetlink: dump link-layer multicast addresses Yuyang Huang
2026-09-05  9:39 ` [PATCH net-next 1/3] rtnetlink: add AF_PACKET multicast dumps Yuyang Huang
2026-09-08 15:56   ` David Ahern [this message]
2026-09-09  1:15     ` Yuyang Huang
2026-09-10  3:41   ` netdev-bot+sashiko
2026-09-10  4:04     ` Yuyang Huang
2026-09-05  9:39 ` [PATCH net-next 2/3] netlink: specs: rt-addr: document " Yuyang Huang
2026-09-05  9:39 ` [PATCH net-next 3/3] selftests: net: test " Yuyang Huang
2026-09-10  3:41   ` netdev-bot+sashiko
2026-09-10  4:05     ` Yuyang Huang
2026-09-07 12:51 ` [PATCH net-next 0/3] rtnetlink: dump link-layer multicast addresses Nicolas Dichtel
2026-09-08  2:56   ` Yuyang Huang
2026-09-08  9:23     ` Nicolas Dichtel

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=1673485d-5529-415b-b1b6-60e27291e3bf@kernel.org \
    --to=dsahern@kernel.org \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nickgarlis@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=sd@queasysnail.net \
    --cc=sdf.kernel@gmail.com \
    --cc=shuah@kernel.org \
    --cc=sigefriedhyy@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.