Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4d1366d authored by Jamal Hadi Salim's avatar Jamal Hadi Salim Committed by David S. Miller
Browse files

[GENETLINK]: Add cmd dump completion.



Remove assumption that generic netlink commands cannot have dump
completion callbacks.

Signed-off-by: default avatarJamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c40a27f4
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -53,6 +53,7 @@ struct genl_info
 * @policy: attribute validation policy
 * @policy: attribute validation policy
 * @doit: standard command callback
 * @doit: standard command callback
 * @dumpit: callback for dumpers
 * @dumpit: callback for dumpers
 * @done: completion callback for dumps
 * @ops_list: operations list
 * @ops_list: operations list
 */
 */
struct genl_ops
struct genl_ops
@@ -64,6 +65,7 @@ struct genl_ops
				       struct genl_info *info);
				       struct genl_info *info);
	int		       (*dumpit)(struct sk_buff *skb,
	int		       (*dumpit)(struct sk_buff *skb,
					 struct netlink_callback *cb);
					 struct netlink_callback *cb);
	int		       (*done)(struct netlink_callback *cb);
	struct list_head	ops_list;
	struct list_head	ops_list;
};
};


+1 −1
Original line number Original line Diff line number Diff line
@@ -331,7 +331,7 @@ static int genl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
		}
		}


		*errp = err = netlink_dump_start(genl_sock, skb, nlh,
		*errp = err = netlink_dump_start(genl_sock, skb, nlh,
						 ops->dumpit, NULL);
						 ops->dumpit, ops->done);
		if (err == 0)
		if (err == 0)
			skb_pull(skb, min(NLMSG_ALIGN(nlh->nlmsg_len),
			skb_pull(skb, min(NLMSG_ALIGN(nlh->nlmsg_len),
					  skb->len));
					  skb->len));