aboutsummaryrefslogtreecommitdiffstats
path: root/net/decnet
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2012-06-29 02:15:21 -0400
committerDavid S. Miller <davem@davemloft.net>2012-06-29 19:46:02 -0400
commita31f2d17b331db970259e875b7223d3aba7e3821 (patch)
tree0d10021be81446ab360f4240b0d16729f518387f /net/decnet
parentdd7f36ba3ce17d4fe85987d83efd5901b0935816 (diff)
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>
Diffstat (limited to 'net/decnet')
-rw-r--r--net/decnet/netfilter/dn_rtmsg.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/decnet/netfilter/dn_rtmsg.c b/net/decnet/netfilter/dn_rtmsg.c
index b8f7f5b8c350..11db0ecf342f 100644
--- a/net/decnet/netfilter/dn_rtmsg.c
+++ b/net/decnet/netfilter/dn_rtmsg.c
@@ -125,11 +125,13 @@ static struct nf_hook_ops dnrmg_ops __read_mostly = {
125static int __init dn_rtmsg_init(void) 125static int __init dn_rtmsg_init(void)
126{ 126{
127 int rv = 0; 127 int rv = 0;
128 struct netlink_kernel_cfg cfg = {
129 .groups = DNRNG_NLGRP_MAX,
130 .input = dnrmg_receive_user_skb,
131 };
128 132
129 dnrmg = netlink_kernel_create(&init_net, 133 dnrmg = netlink_kernel_create(&init_net,
130 NETLINK_DNRTMSG, DNRNG_NLGRP_MAX, 134 NETLINK_DNRTMSG, THIS_MODULE, &cfg);
131 dnrmg_receive_user_skb,
132 NULL, THIS_MODULE);
133 if (dnrmg == NULL) { 135 if (dnrmg == NULL) {
134 printk(KERN_ERR "dn_rtmsg: Cannot create netlink socket"); 136 printk(KERN_ERR "dn_rtmsg: Cannot create netlink socket");
135 return -ENOMEM; 137 return -ENOMEM;