diff options
Diffstat (limited to 'net/netlabel/netlabel_mgmt.c')
-rw-r--r-- | net/netlabel/netlabel_mgmt.c | 42 |
1 files changed, 14 insertions, 28 deletions
diff --git a/net/netlabel/netlabel_mgmt.c b/net/netlabel/netlabel_mgmt.c index 53c9079ad2c3..e8c80f33f3d7 100644 --- a/net/netlabel/netlabel_mgmt.c +++ b/net/netlabel/netlabel_mgmt.c | |||
@@ -188,12 +188,9 @@ static int netlbl_mgmt_listall_cb(struct netlbl_dom_map *entry, void *arg) | |||
188 | struct netlbl_domhsh_walk_arg *cb_arg = arg; | 188 | struct netlbl_domhsh_walk_arg *cb_arg = arg; |
189 | void *data; | 189 | void *data; |
190 | 190 | ||
191 | data = netlbl_netlink_hdr_put(cb_arg->skb, | 191 | data = genlmsg_put(cb_arg->skb, NETLINK_CB(cb_arg->nl_cb->skb).pid, |
192 | NETLINK_CB(cb_arg->nl_cb->skb).pid, | 192 | cb_arg->seq, &netlbl_mgmt_gnl_family, |
193 | cb_arg->seq, | 193 | NLM_F_MULTI, NLBL_MGMT_C_LISTALL); |
194 | netlbl_mgmt_gnl_family.id, | ||
195 | NLM_F_MULTI, | ||
196 | NLBL_MGMT_C_LISTALL); | ||
197 | if (data == NULL) | 194 | if (data == NULL) |
198 | goto listall_cb_failure; | 195 | goto listall_cb_failure; |
199 | 196 | ||
@@ -356,15 +353,11 @@ static int netlbl_mgmt_listdef(struct sk_buff *skb, struct genl_info *info) | |||
356 | void *data; | 353 | void *data; |
357 | struct netlbl_dom_map *entry; | 354 | struct netlbl_dom_map *entry; |
358 | 355 | ||
359 | ans_skb = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); | 356 | ans_skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); |
360 | if (ans_skb == NULL) | 357 | if (ans_skb == NULL) |
361 | return -ENOMEM; | 358 | return -ENOMEM; |
362 | data = netlbl_netlink_hdr_put(ans_skb, | 359 | data = genlmsg_put_reply(ans_skb, info, &netlbl_mgmt_gnl_family, |
363 | info->snd_pid, | 360 | 0, NLBL_MGMT_C_LISTDEF); |
364 | info->snd_seq, | ||
365 | netlbl_mgmt_gnl_family.id, | ||
366 | 0, | ||
367 | NLBL_MGMT_C_LISTDEF); | ||
368 | if (data == NULL) | 361 | if (data == NULL) |
369 | goto listdef_failure; | 362 | goto listdef_failure; |
370 | 363 | ||
@@ -390,7 +383,7 @@ static int netlbl_mgmt_listdef(struct sk_buff *skb, struct genl_info *info) | |||
390 | 383 | ||
391 | genlmsg_end(ans_skb, data); | 384 | genlmsg_end(ans_skb, data); |
392 | 385 | ||
393 | ret_val = genlmsg_unicast(ans_skb, info->snd_pid); | 386 | ret_val = genlmsg_reply(ans_skb, info); |
394 | if (ret_val != 0) | 387 | if (ret_val != 0) |
395 | goto listdef_failure; | 388 | goto listdef_failure; |
396 | return 0; | 389 | return 0; |
@@ -422,12 +415,9 @@ static int netlbl_mgmt_protocols_cb(struct sk_buff *skb, | |||
422 | int ret_val = -ENOMEM; | 415 | int ret_val = -ENOMEM; |
423 | void *data; | 416 | void *data; |
424 | 417 | ||
425 | data = netlbl_netlink_hdr_put(skb, | 418 | data = genlmsg_put(skb, NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq, |
426 | NETLINK_CB(cb->skb).pid, | 419 | &netlbl_mgmt_gnl_family, NLM_F_MULTI, |
427 | cb->nlh->nlmsg_seq, | 420 | NLBL_MGMT_C_PROTOCOLS); |
428 | netlbl_mgmt_gnl_family.id, | ||
429 | NLM_F_MULTI, | ||
430 | NLBL_MGMT_C_PROTOCOLS); | ||
431 | if (data == NULL) | 421 | if (data == NULL) |
432 | goto protocols_cb_failure; | 422 | goto protocols_cb_failure; |
433 | 423 | ||
@@ -492,15 +482,11 @@ static int netlbl_mgmt_version(struct sk_buff *skb, struct genl_info *info) | |||
492 | struct sk_buff *ans_skb = NULL; | 482 | struct sk_buff *ans_skb = NULL; |
493 | void *data; | 483 | void *data; |
494 | 484 | ||
495 | ans_skb = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); | 485 | ans_skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); |
496 | if (ans_skb == NULL) | 486 | if (ans_skb == NULL) |
497 | return -ENOMEM; | 487 | return -ENOMEM; |
498 | data = netlbl_netlink_hdr_put(ans_skb, | 488 | data = genlmsg_put_reply(ans_skb, info, &netlbl_mgmt_gnl_family, |
499 | info->snd_pid, | 489 | 0, NLBL_MGMT_C_VERSION); |
500 | info->snd_seq, | ||
501 | netlbl_mgmt_gnl_family.id, | ||
502 | 0, | ||
503 | NLBL_MGMT_C_VERSION); | ||
504 | if (data == NULL) | 490 | if (data == NULL) |
505 | goto version_failure; | 491 | goto version_failure; |
506 | 492 | ||
@@ -512,7 +498,7 @@ static int netlbl_mgmt_version(struct sk_buff *skb, struct genl_info *info) | |||
512 | 498 | ||
513 | genlmsg_end(ans_skb, data); | 499 | genlmsg_end(ans_skb, data); |
514 | 500 | ||
515 | ret_val = genlmsg_unicast(ans_skb, info->snd_pid); | 501 | ret_val = genlmsg_reply(ans_skb, info); |
516 | if (ret_val != 0) | 502 | if (ret_val != 0) |
517 | goto version_failure; | 503 | goto version_failure; |
518 | return 0; | 504 | return 0; |