Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Florian Westphal and committed by
David S. Miller
263ea090 551ddc05

+5 -31
-4
include/net/genetlink.h
··· 83 83 * @attrs: netlink attributes 84 84 * @_net: network namespace 85 85 * @user_ptr: user pointers 86 - * @dst_sk: destination socket 87 86 */ 88 87 struct genl_info { 89 88 u32 snd_seq; ··· 93 94 struct nlattr ** attrs; 94 95 possible_net_t _net; 95 96 void * user_ptr[2]; 96 - struct sock * dst_sk; 97 97 }; 98 98 99 99 static inline struct net *genl_info_net(struct genl_info *info) ··· 186 188 void genl_notify(struct genl_family *family, struct sk_buff *skb, 187 189 struct genl_info *info, u32 group, gfp_t flags); 188 190 189 - struct sk_buff *genlmsg_new_unicast(size_t payload, struct genl_info *info, 190 - gfp_t flags); 191 191 void *genlmsg_put(struct sk_buff *skb, u32 portid, u32 seq, 192 192 struct genl_family *family, int flags, u8 cmd); 193 193
-21
net/netlink/genetlink.c
··· 463 463 EXPORT_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 - */ 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 - 485 - /** 486 466 * genlmsg_put - Add generic netlink header to netlink message 487 467 * @skb: socket buffer holding the message 488 468 * @portid: netlink portid the message is addressed to ··· 622 642 info.genlhdr = nlmsg_data(nlh); 623 643 info.userhdr = nlmsg_data(nlh) + GENL_HDRLEN; 624 644 info.attrs = attrbuf; 625 - info.dst_sk = skb->sk; 626 645 genl_info_net_set(&info, net); 627 646 memset(&info.user_ptr, 0, sizeof(info.user_ptr)); 628 647
+5 -5
net/openvswitch/datapath.c
··· 1477 1477 return -EMSGSIZE; 1478 1478 } 1479 1479 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) 1481 1481 { 1482 1482 return genlmsg_new(ovs_dp_cmd_msg_size(), GFP_KERNEL); 1483 1483 } ··· 1532 1532 if (!a[OVS_DP_ATTR_NAME] || !a[OVS_DP_ATTR_UPCALL_PID]) 1533 1533 goto err; 1534 1534 1535 - reply = ovs_dp_cmd_alloc_info(info); 1535 + reply = ovs_dp_cmd_alloc_info(); 1536 1536 if (!reply) 1537 1537 return -ENOMEM; 1538 1538 ··· 1653 1653 struct datapath *dp; 1654 1654 int err; 1655 1655 1656 - reply = ovs_dp_cmd_alloc_info(info); 1656 + reply = ovs_dp_cmd_alloc_info(); 1657 1657 if (!reply) 1658 1658 return -ENOMEM; 1659 1659 ··· 1686 1686 struct datapath *dp; 1687 1687 int err; 1688 1688 1689 - reply = ovs_dp_cmd_alloc_info(info); 1689 + reply = ovs_dp_cmd_alloc_info(); 1690 1690 if (!reply) 1691 1691 return -ENOMEM; 1692 1692 ··· 1719 1719 struct datapath *dp; 1720 1720 int err; 1721 1721 1722 - reply = ovs_dp_cmd_alloc_info(info); 1722 + reply = ovs_dp_cmd_alloc_info(); 1723 1723 if (!reply) 1724 1724 return -ENOMEM; 1725 1725