aboutsummaryrefslogtreecommitdiffstats
path: root/net/dsa/user.c
diff options
context:
space:
mode:
authorEric Dumazet <[email protected]>2024-12-09 10:07:45 +0000
committerJakub Kicinski <[email protected]>2024-12-11 02:32:32 +0000
commitbe325f08c432ae5ac6d6594d163e1899cdf202df (patch)
tree9282e769a6a9ca546149474befec4c9cc53f9232 /net/dsa/user.c
parentnet: phy: dp83822: Replace DP83822_DEVADDR with MDIO_MMD_VEND2 (diff)
downloadkernel-be325f08c432ae5ac6d6594d163e1899cdf202df.tar.gz
kernel-be325f08c432ae5ac6d6594d163e1899cdf202df.zip
rtnetlink: add ndo_fdb_dump_context
rtnl_fdb_dump() and various ndo_fdb_dump() helpers share a hidden layout of cb->ctx. Before switching rtnl_fdb_dump() to for_each_netdev_dump() in the following patch, make this more explicit. Signed-off-by: Eric Dumazet <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> Reviewed-by: Kuniyuki Iwashima <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/dsa/user.c')
-rw-r--r--net/dsa/user.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/dsa/user.c b/net/dsa/user.c
index 06c30a9e29ff..c736c019e2af 100644
--- a/net/dsa/user.c
+++ b/net/dsa/user.c
@@ -515,12 +515,13 @@ dsa_user_port_fdb_do_dump(const unsigned char *addr, u16 vid,
bool is_static, void *data)
{
struct dsa_user_dump_ctx *dump = data;
+ struct ndo_fdb_dump_context *ctx = (void *)dump->cb->ctx;
u32 portid = NETLINK_CB(dump->cb->skb).portid;
u32 seq = dump->cb->nlh->nlmsg_seq;
struct nlmsghdr *nlh;
struct ndmsg *ndm;
- if (dump->idx < dump->cb->args[2])
+ if (dump->idx < ctx->fdb_idx)
goto skip;
nlh = nlmsg_put(dump->skb, portid, seq, RTM_NEWNEIGH,