aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2016-02-18 09:03:26 -0500
committerDavid S. Miller <davem@davemloft.net>2016-02-18 11:42:19 -0500
commit263ea09084d172cac6e40459a690babe8de8e448 (patch)
tree895a8c5db956086687472eda62a9f49fa68c9b3a /net
parent551ddc057e290cc07ff900050da242f35d615d3c (diff)
Revert "genl: Add genlmsg_new_unicast() for unicast message allocation"
This reverts commit bb9b18fb55b0 ("genl: Add genlmsg_new_unicast() for unicast message allocation")'. Nothing wrong with it; its no longer needed since this was only for mmapped netlink support. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/netlink/genetlink.c21
-rw-r--r--net/openvswitch/datapath.c10
-rw-r--r--net/tipc/netlink_compat.c1
3 files changed, 5 insertions, 27 deletions
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index 0ffd721126e7..a09132a69869 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -463,26 +463,6 @@ int genl_unregister_family(struct genl_family *family)
463EXPORT_SYMBOL(genl_unregister_family); 463EXPORT_SYMBOL(genl_unregister_family);
464 464
465/** 465/**
466 * genlmsg_new_unicast - Allocate generic netlink message for unicast
467 * @payload: size of the message payload
468 * @info: information on destination
469 * @flags: the type of memory to allocate
470 *
471 * Allocates a new sk_buff large enough to cover the specified payload
472 * plus required Netlink headers. Will check receiving socket for
473 * memory mapped i/o capability and use it if enabled. Will fall back
474 * to non-mapped skb if message size exceeds the frame size of the ring.
475 */
476struct sk_buff *genlmsg_new_unicast(size_t payload, struct genl_info *info,
477 gfp_t flags)
478{
479 size_t len = nlmsg_total_size(genlmsg_total_size(payload));
480
481 return netlink_alloc_skb(info->dst_sk, len, info->snd_portid, flags);
482}
483EXPORT_SYMBOL_GPL(genlmsg_new_unicast);
484
485/**
486 * genlmsg_put - Add generic netlink header to netlink message 466 * genlmsg_put - Add generic netlink header to netlink message
487 * @skb: socket buffer holding the message 467 * @skb: socket buffer holding the message
488 * @portid: netlink portid the message is addressed to 468 * @portid: netlink portid the message is addressed to
@@ -642,7 +622,6 @@ static int genl_family_rcv_msg(struct genl_family *family,
642 info.genlhdr = nlmsg_data(nlh); 622 info.genlhdr = nlmsg_data(nlh);
643 info.userhdr = nlmsg_data(nlh) + GENL_HDRLEN; 623 info.userhdr = nlmsg_data(nlh) + GENL_HDRLEN;
644 info.attrs = attrbuf; 624 info.attrs = attrbuf;
645 info.dst_sk = skb->sk;
646 genl_info_net_set(&info, net); 625 genl_info_net_set(&info, net);
647 memset(&info.user_ptr, 0, sizeof(info.user_ptr)); 626 memset(&info.user_ptr, 0, sizeof(info.user_ptr));
648 627
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index 35a2659a277e..c4e8455d5d56 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -1477,7 +1477,7 @@ error:
1477 return -EMSGSIZE; 1477 return -EMSGSIZE;
1478} 1478}
1479 1479
1480static struct sk_buff *ovs_dp_cmd_alloc_info(struct genl_info *info) 1480static struct sk_buff *ovs_dp_cmd_alloc_info(void)
1481{ 1481{
1482 return genlmsg_new(ovs_dp_cmd_msg_size(), GFP_KERNEL); 1482 return genlmsg_new(ovs_dp_cmd_msg_size(), GFP_KERNEL);
1483} 1483}
@@ -1532,7 +1532,7 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info)
1532 if (!a[OVS_DP_ATTR_NAME] || !a[OVS_DP_ATTR_UPCALL_PID]) 1532 if (!a[OVS_DP_ATTR_NAME] || !a[OVS_DP_ATTR_UPCALL_PID])
1533 goto err; 1533 goto err;
1534 1534
1535 reply = ovs_dp_cmd_alloc_info(info); 1535 reply = ovs_dp_cmd_alloc_info();
1536 if (!reply) 1536 if (!reply)
1537 return -ENOMEM; 1537 return -ENOMEM;
1538 1538
@@ -1653,7 +1653,7 @@ static int ovs_dp_cmd_del(struct sk_buff *skb, struct genl_info *info)
1653 struct datapath *dp; 1653 struct datapath *dp;
1654 int err; 1654 int err;
1655 1655
1656 reply = ovs_dp_cmd_alloc_info(info); 1656 reply = ovs_dp_cmd_alloc_info();
1657 if (!reply) 1657 if (!reply)
1658 return -ENOMEM; 1658 return -ENOMEM;
1659 1659
@@ -1686,7 +1686,7 @@ static int ovs_dp_cmd_set(struct sk_buff *skb, struct genl_info *info)
1686 struct datapath *dp; 1686 struct datapath *dp;
1687 int err; 1687 int err;
1688 1688
1689 reply = ovs_dp_cmd_alloc_info(info); 1689 reply = ovs_dp_cmd_alloc_info();
1690 if (!reply) 1690 if (!reply)
1691 return -ENOMEM; 1691 return -ENOMEM;
1692 1692
@@ -1719,7 +1719,7 @@ static int ovs_dp_cmd_get(struct sk_buff *skb, struct genl_info *info)
1719 struct datapath *dp; 1719 struct datapath *dp;
1720 int err; 1720 int err;
1721 1721
1722 reply = ovs_dp_cmd_alloc_info(info); 1722 reply = ovs_dp_cmd_alloc_info();
1723 if (!reply) 1723 if (!reply)
1724 return -ENOMEM; 1724 return -ENOMEM;
1725 1725
diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c
index 2c016fdefe97..de66d8f945ed 100644
--- a/net/tipc/netlink_compat.c
+++ b/net/tipc/netlink_compat.c
@@ -1104,7 +1104,6 @@ static int tipc_nl_compat_recv(struct sk_buff *skb, struct genl_info *info)
1104 req_nlh = (struct nlmsghdr *)skb->data; 1104 req_nlh = (struct nlmsghdr *)skb->data;
1105 msg.req = nlmsg_data(req_nlh) + GENL_HDRLEN + TIPC_GENL_HDRLEN; 1105 msg.req = nlmsg_data(req_nlh) + GENL_HDRLEN + TIPC_GENL_HDRLEN;
1106 msg.cmd = req_userhdr->cmd; 1106 msg.cmd = req_userhdr->cmd;
1107 msg.dst_sk = info->dst_sk;
1108 msg.net = genl_info_net(info); 1107 msg.net = genl_info_net(info);
1109 1108
1110 if ((msg.cmd & 0xC000) && (!netlink_net_capable(skb, CAP_NET_ADMIN))) { 1109 if ((msg.cmd & 0xC000) && (!netlink_net_capable(skb, CAP_NET_ADMIN))) {