Skip to content

Commit 263ea09

Browse files
Florian Westphaldavem330
authored andcommitted
Revert "genl: Add genlmsg_new_unicast() for unicast message allocation"
This reverts commit bb9b18f ("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>
1 parent 551ddc0 commit 263ea09

4 files changed

Lines changed: 5 additions & 31 deletions

File tree

‎include/net/genetlink.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ struct genl_family {
8383
* @attrs: netlink attributes
8484
* @_net: network namespace
8585
* @user_ptr: user pointers
86-
* @dst_sk: destination socket
8786
*/
8887
struct genl_info {
8988
u32 snd_seq;
@@ -94,7 +93,6 @@ struct genl_info {
9493
struct nlattr ** attrs;
9594
possible_net_t _net;
9695
void * user_ptr[2];
97-
struct sock * dst_sk;
9896
};
9997

10098
static inline struct net *genl_info_net(struct genl_info *info)
@@ -188,8 +186,6 @@ int genl_unregister_family(struct genl_family *family);
188186
void genl_notify(struct genl_family *family, struct sk_buff *skb,
189187
struct genl_info *info, u32 group, gfp_t flags);
190188

191-
struct sk_buff *genlmsg_new_unicast(size_t payload, struct genl_info *info,
192-
gfp_t flags);
193189
void *genlmsg_put(struct sk_buff *skb, u32 portid, u32 seq,
194190
struct genl_family *family, int flags, u8 cmd);
195191

‎net/netlink/genetlink.c‎

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -462,26 +462,6 @@ int genl_unregister_family(struct genl_family *family)
462462
}
463463
EXPORT_SYMBOL(genl_unregister_family);
464464

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-
*/
476-
struct 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-
}
483-
EXPORT_SYMBOL_GPL(genlmsg_new_unicast);
484-
485465
/**
486466
* genlmsg_put - Add generic netlink header to netlink message
487467
* @skb: socket buffer holding the message
@@ -642,7 +622,6 @@ static int genl_family_rcv_msg(struct genl_family *family,
642622
info.genlhdr = nlmsg_data(nlh);
643623
info.userhdr = nlmsg_data(nlh) + GENL_HDRLEN;
644624
info.attrs = attrbuf;
645-
info.dst_sk = skb->sk;
646625
genl_info_net_set(&info, net);
647626
memset(&info.user_ptr, 0, sizeof(info.user_ptr));
648627

‎net/openvswitch/datapath.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,7 +1477,7 @@ static int ovs_dp_cmd_fill_info(struct datapath *dp, struct sk_buff *skb,
14771477
return -EMSGSIZE;
14781478
}
14791479

1480-
static struct sk_buff *ovs_dp_cmd_alloc_info(struct genl_info *info)
1480+
static struct sk_buff *ovs_dp_cmd_alloc_info(void)
14811481
{
14821482
return genlmsg_new(ovs_dp_cmd_msg_size(), GFP_KERNEL);
14831483
}
@@ -1532,7 +1532,7 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info)
15321532
if (!a[OVS_DP_ATTR_NAME] || !a[OVS_DP_ATTR_UPCALL_PID])
15331533
goto err;
15341534

1535-
reply = ovs_dp_cmd_alloc_info(info);
1535+
reply = ovs_dp_cmd_alloc_info();
15361536
if (!reply)
15371537
return -ENOMEM;
15381538

@@ -1653,7 +1653,7 @@ static int ovs_dp_cmd_del(struct sk_buff *skb, struct genl_info *info)
16531653
struct datapath *dp;
16541654
int err;
16551655

1656-
reply = ovs_dp_cmd_alloc_info(info);
1656+
reply = ovs_dp_cmd_alloc_info();
16571657
if (!reply)
16581658
return -ENOMEM;
16591659

@@ -1686,7 +1686,7 @@ static int ovs_dp_cmd_set(struct sk_buff *skb, struct genl_info *info)
16861686
struct datapath *dp;
16871687
int err;
16881688

1689-
reply = ovs_dp_cmd_alloc_info(info);
1689+
reply = ovs_dp_cmd_alloc_info();
16901690
if (!reply)
16911691
return -ENOMEM;
16921692

@@ -1719,7 +1719,7 @@ static int ovs_dp_cmd_get(struct sk_buff *skb, struct genl_info *info)
17191719
struct datapath *dp;
17201720
int err;
17211721

1722-
reply = ovs_dp_cmd_alloc_info(info);
1722+
reply = ovs_dp_cmd_alloc_info();
17231723
if (!reply)
17241724
return -ENOMEM;
17251725

‎net/tipc/netlink_compat.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,6 @@ static int tipc_nl_compat_recv(struct sk_buff *skb, struct genl_info *info)
11041104
req_nlh = (struct nlmsghdr *)skb->data;
11051105
msg.req = nlmsg_data(req_nlh) + GENL_HDRLEN + TIPC_GENL_HDRLEN;
11061106
msg.cmd = req_userhdr->cmd;
1107-
msg.dst_sk = info->dst_sk;
11081107
msg.net = genl_info_net(info);
11091108

11101109
if ((msg.cmd & 0xC000) && (!netlink_net_capable(skb, CAP_NET_ADMIN))) {

0 commit comments

Comments
 (0)