summaryrefslogtreecommitdiff
path: root/net/netlink/af_netlink.h
diff options
context:
space:
mode:
authorGao feng <gaofeng@cn.fujitsu.com>2013-06-06 10:49:11 +0400
committerDavid S. Miller <davem@davemloft.net>2013-06-11 13:39:42 +0400
commitda12c90e099789a63073fc82a19542ce54d4efb9 (patch)
treeb4343bfeaa8f929225268dd0ef3c92b31efbd4ae /net/netlink/af_netlink.h
parent8249152c472e10c18936b774737fd58c60335154 (diff)
downloadlinux-da12c90e099789a63073fc82a19542ce54d4efb9.tar.xz
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 'net/netlink/af_netlink.h')
-rw-r--r--net/netlink/af_netlink.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/netlink/af_netlink.h b/net/netlink/af_netlink.h
index ed8522265f4e..eaa88d187cdc 100644
--- a/net/netlink/af_netlink.h
+++ b/net/netlink/af_netlink.h
@@ -73,6 +73,7 @@ struct netlink_table {
struct mutex *cb_mutex;
struct module *module;
void (*bind)(int group);
+ bool (*compare)(struct net *net, struct sock *sock);
int registered;
};