diff options
Diffstat (limited to 'net/tipc/bearer.c')
| -rw-r--r-- | net/tipc/bearer.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index 3613e72e858e..70e3dacbf84a 100644 --- a/net/tipc/bearer.c +++ b/net/tipc/bearer.c | |||
| @@ -591,14 +591,14 @@ void tipc_bearer_stop(struct net *net) | |||
| 591 | 591 | ||
| 592 | /* Caller should hold rtnl_lock to protect the bearer */ | 592 | /* Caller should hold rtnl_lock to protect the bearer */ |
| 593 | static int __tipc_nl_add_bearer(struct tipc_nl_msg *msg, | 593 | static int __tipc_nl_add_bearer(struct tipc_nl_msg *msg, |
| 594 | struct tipc_bearer *bearer) | 594 | struct tipc_bearer *bearer, int nlflags) |
| 595 | { | 595 | { |
| 596 | void *hdr; | 596 | void *hdr; |
| 597 | struct nlattr *attrs; | 597 | struct nlattr *attrs; |
| 598 | struct nlattr *prop; | 598 | struct nlattr *prop; |
| 599 | 599 | ||
| 600 | hdr = genlmsg_put(msg->skb, msg->portid, msg->seq, &tipc_genl_family, | 600 | hdr = genlmsg_put(msg->skb, msg->portid, msg->seq, &tipc_genl_family, |
| 601 | NLM_F_MULTI, TIPC_NL_BEARER_GET); | 601 | nlflags, TIPC_NL_BEARER_GET); |
| 602 | if (!hdr) | 602 | if (!hdr) |
| 603 | return -EMSGSIZE; | 603 | return -EMSGSIZE; |
| 604 | 604 | ||
| @@ -657,7 +657,7 @@ int tipc_nl_bearer_dump(struct sk_buff *skb, struct netlink_callback *cb) | |||
| 657 | if (!bearer) | 657 | if (!bearer) |
| 658 | continue; | 658 | continue; |
| 659 | 659 | ||
| 660 | err = __tipc_nl_add_bearer(&msg, bearer); | 660 | err = __tipc_nl_add_bearer(&msg, bearer, NLM_F_MULTI); |
| 661 | if (err) | 661 | if (err) |
| 662 | break; | 662 | break; |
| 663 | } | 663 | } |
| @@ -705,7 +705,7 @@ int tipc_nl_bearer_get(struct sk_buff *skb, struct genl_info *info) | |||
| 705 | goto err_out; | 705 | goto err_out; |
| 706 | } | 706 | } |
| 707 | 707 | ||
| 708 | err = __tipc_nl_add_bearer(&msg, bearer); | 708 | err = __tipc_nl_add_bearer(&msg, bearer, 0); |
| 709 | if (err) | 709 | if (err) |
| 710 | goto err_out; | 710 | goto err_out; |
| 711 | rtnl_unlock(); | 711 | rtnl_unlock(); |
| @@ -857,14 +857,14 @@ int tipc_nl_bearer_set(struct sk_buff *skb, struct genl_info *info) | |||
| 857 | } | 857 | } |
| 858 | 858 | ||
| 859 | static int __tipc_nl_add_media(struct tipc_nl_msg *msg, | 859 | static int __tipc_nl_add_media(struct tipc_nl_msg *msg, |
| 860 | struct tipc_media *media) | 860 | struct tipc_media *media, int nlflags) |
| 861 | { | 861 | { |
| 862 | void *hdr; | 862 | void *hdr; |
| 863 | struct nlattr *attrs; | 863 | struct nlattr *attrs; |
| 864 | struct nlattr *prop; | 864 | struct nlattr *prop; |
| 865 | 865 | ||
| 866 | hdr = genlmsg_put(msg->skb, msg->portid, msg->seq, &tipc_genl_family, | 866 | hdr = genlmsg_put(msg->skb, msg->portid, msg->seq, &tipc_genl_family, |
| 867 | NLM_F_MULTI, TIPC_NL_MEDIA_GET); | 867 | nlflags, TIPC_NL_MEDIA_GET); |
| 868 | if (!hdr) | 868 | if (!hdr) |
| 869 | return -EMSGSIZE; | 869 | return -EMSGSIZE; |
| 870 | 870 | ||
| @@ -916,7 +916,8 @@ int tipc_nl_media_dump(struct sk_buff *skb, struct netlink_callback *cb) | |||
| 916 | 916 | ||
| 917 | rtnl_lock(); | 917 | rtnl_lock(); |
| 918 | for (; media_info_array[i] != NULL; i++) { | 918 | for (; media_info_array[i] != NULL; i++) { |
| 919 | err = __tipc_nl_add_media(&msg, media_info_array[i]); | 919 | err = __tipc_nl_add_media(&msg, media_info_array[i], |
| 920 | NLM_F_MULTI); | ||
| 920 | if (err) | 921 | if (err) |
| 921 | break; | 922 | break; |
| 922 | } | 923 | } |
| @@ -963,7 +964,7 @@ int tipc_nl_media_get(struct sk_buff *skb, struct genl_info *info) | |||
| 963 | goto err_out; | 964 | goto err_out; |
| 964 | } | 965 | } |
| 965 | 966 | ||
| 966 | err = __tipc_nl_add_media(&msg, media); | 967 | err = __tipc_nl_add_media(&msg, media, 0); |
| 967 | if (err) | 968 | if (err) |
| 968 | goto err_out; | 969 | goto err_out; |
| 969 | rtnl_unlock(); | 970 | rtnl_unlock(); |
