summaryrefslogtreecommitdiff
path: root/include/linux/netlink.h
diff options
context:
space:
mode:
authorGao feng <gaofeng@cn.fujitsu.com>2013-06-06 14:49:11 +0800
committerDavid S. Miller <davem@davemloft.net>2013-06-11 02:39:42 -0700
commitda12c90e099789a63073fc82a19542ce54d4efb9 (patch)
treeb4343bfeaa8f929225268dd0ef3c92b31efbd4ae /include/linux/netlink.h
parent8249152c472e10c18936b774737fd58c60335154 (diff)
downloadlwn-da12c90e099789a63073fc82a19542ce54d4efb9.tar.gz
lwn-da12c90e099789a63073fc82a19542ce54d4efb9.zip
netlink: Add compare function for netlink_table
As we know, netlink sockets are private resource of net namespace, they can communicate with each other only when they in the same net namespace. this works well until we try to add namespace support for other subsystems which use netlink. Don't like ipv4 and route table.., it is not suited to make these subsytems belong to net namespace, Such as audit and crypto subsystems,they are more suitable to user namespace. So we must have the ability to make the netlink sockets in same user namespace can communicate with each other. This patch adds a new function pointer "compare" for netlink_table, we can decide if the netlink sockets can communicate with each other through this netlink_table self-defined compare function. The behavior isn't changed if we don't provide the compare function for netlink_table. Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com> Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netlink.h')
-rw-r--r--include/linux/netlink.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 6358da5eeee8..f78b430f4af5 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -46,6 +46,7 @@ struct netlink_kernel_cfg {
void (*input)(struct sk_buff *skb);
struct mutex *cb_mutex;
void (*bind)(int group);
+ bool (*compare)(struct net *net, struct sock *sk);
};
extern struct sock *__netlink_kernel_create(struct net *net, int unit,