[GENL]: Add genlmsg_put_reply() to simplify building reply headers
By modyfing genlmsg_put() to take a genl_family and by adding genlmsg_put_reply() the process of constructing the netlink and generic netlink headers is simplified. Signed-off-by: Thomas Graf <tgraf@suug.ch> Acked-by: Paul Moore <paul.moore@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
81878d27fd
commit
17c157c889
@@ -141,12 +141,8 @@ static int netlbl_unlabel_list(struct sk_buff *skb, struct genl_info *info)
|
||||
ans_skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
|
||||
if (ans_skb == NULL)
|
||||
goto list_failure;
|
||||
data = netlbl_netlink_hdr_put(ans_skb,
|
||||
info->snd_pid,
|
||||
info->snd_seq,
|
||||
netlbl_unlabel_gnl_family.id,
|
||||
0,
|
||||
NLBL_UNLABEL_C_LIST);
|
||||
data = genlmsg_put_reply(ans_skb, info, &netlbl_unlabel_gnl_family,
|
||||
0, NLBL_UNLABEL_C_LIST);
|
||||
if (data == NULL) {
|
||||
ret_val = -ENOMEM;
|
||||
goto list_failure;
|
||||
|
||||
Reference in New Issue
Block a user