Commit f862ed2d authored by Jiri Pirko's avatar Jiri Pirko Committed by Jakub Kicinski
Browse files

genetlink: don't merge dumpit split op for different cmds into single iter



Currently, split ops of doit and dumpit are merged into a single iter
item when they are subsequent. However, there is no guarantee that the
dumpit op is for the same cmd as doit op.

Fix this by checking if cmd is the same for both.
This problem does not occur in existing families.

Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Link: https://lore.kernel.org/r/20231021112711.660606-2-jiri@resnulli.us


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent b7c4f573
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -225,7 +225,8 @@ static void genl_op_from_split(struct genl_op_iter *iter)
	}

	if (i + cnt < family->n_split_ops &&
	    family->split_ops[i + cnt].flags & GENL_CMD_CAP_DUMP) {
	    family->split_ops[i + cnt].flags & GENL_CMD_CAP_DUMP &&
	    (!cnt || family->split_ops[i + cnt].cmd == iter->doit.cmd)) {
		iter->dumpit = family->split_ops[i + cnt];
		genl_op_fill_in_reject_policy_split(family, &iter->dumpit);
		cnt++;