summaryrefslogtreecommitdiffstats
path: root/include/linux/netlink.h
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2013-04-17 06:47:04 +0000
committerDavid S. Miller <davem@davemloft.net>2013-04-19 14:57:58 -0400
commitf9c2288837ba072b21dba955f04a4c97eaa77b1e (patch)
treec02c28e33176fc82b8fd560b3a850351b28617e2 /include/linux/netlink.h
parent5fd96123ee19b96be7d7b57fd42227e1a146ef05 (diff)
downloadlinux-f9c2288837ba072b21dba955f04a4c97eaa77b1e.tar.gz
linux-f9c2288837ba072b21dba955f04a4c97eaa77b1e.tar.bz2
linux-f9c2288837ba072b21dba955f04a4c97eaa77b1e.zip
netlink: implement memory mapped recvmsg()
Add support for mmap'ed recvmsg(). To allow the kernel to construct messages into the mapped area, a dataless skb is allocated and the data pointer is set to point into the ring frame. This means frames will be delivered to userspace in order of allocation instead of order of transmission. This usually doesn't matter since the order is either not determinable by userspace or message creation/transmission is serialized. The only case where this can have a visible difference is nfnetlink_queue. Userspace can't assume mmap'ed messages have ordered IDs anymore and needs to check this if using batched verdicts. For non-mapped sockets, nothing changes. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netlink.h')
-rw-r--r--include/linux/netlink.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 07c473848dbd..6358da5eeee8 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -64,6 +64,8 @@ extern void __netlink_clear_multicast_users(struct sock *sk, unsigned int group)
extern void netlink_clear_multicast_users(struct sock *sk, unsigned int group);
extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err);
extern int netlink_has_listeners(struct sock *sk, unsigned int group);
+extern struct sk_buff *netlink_alloc_skb(struct sock *ssk, unsigned int size,
+ u32 dst_portid, gfp_t gfp_mask);
extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 portid, int nonblock);
extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 portid,
__u32 group, gfp_t allocation);