netlink: add netlink_kernel_cfg parameter to netlink_kernel_create
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 29 Jun 2012 06:15:21 +0000 (06:15 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 29 Jun 2012 23:46:02 +0000 (16:46 -0700)
commita31f2d17b331db970259e875b7223d3aba7e3821
tree0d10021be81446ab360f4240b0d16729f518387f
parentdd7f36ba3ce17d4fe85987d83efd5901b0935816
netlink: add netlink_kernel_cfg parameter to netlink_kernel_create

This patch adds the following structure:

struct netlink_kernel_cfg {
        unsigned int    groups;
        void            (*input)(struct sk_buff *skb);
        struct mutex    *cb_mutex;
};

That can be passed to netlink_kernel_create to set optional configurations
for netlink kernel sockets.

I've populated this structure by looking for NULL and zero parameters at the
existing code. The remaining parameters that always need to be set are still
left in the original interface.

That includes optional parameters for the netlink socket creation. This allows
easy extensibility of this interface in the future.

This patch also adapts all callers to use this new interface.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
20 files changed:
crypto/crypto_user.c
drivers/connector/connector.c
drivers/infiniband/core/netlink.c
drivers/scsi/scsi_netlink.c
drivers/scsi/scsi_transport_iscsi.c
drivers/staging/gdm72xx/netlink_k.c
include/linux/netlink.h
kernel/audit.c
lib/kobject_uevent.c
net/bridge/netfilter/ebt_ulog.c
net/core/rtnetlink.c
net/core/sock_diag.c
net/decnet/netfilter/dn_rtmsg.c
net/ipv4/fib_frontend.c
net/ipv4/netfilter/ipt_ULOG.c
net/netfilter/nfnetlink.c
net/netlink/af_netlink.c
net/netlink/genetlink.c
net/xfrm/xfrm_user.c
security/selinux/netlink.c