diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2012-09-07 22:53:54 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-09-08 18:46:30 -0400 |
commit | 9f00d9776bc5beb92e8bfc884a7e96ddc5589e2e (patch) | |
tree | 2a9f9513a13c73cb1196ebe3426389c1140e2888 /net | |
parent | 9785e10aedfa0fad5c1aac709dce5ada1b123783 (diff) |
netlink: hide struct module parameter in netlink_kernel_create
This patch defines netlink_kernel_create as a wrapper function of
__netlink_kernel_create to hide the struct module *me parameter
(which seems to be THIS_MODULE in all existing netlink subsystems).
Suggested by David S. Miller.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/bridge/netfilter/ebt_ulog.c | 3 | ||||
-rw-r--r-- | net/core/rtnetlink.c | 2 | ||||
-rw-r--r-- | net/core/sock_diag.c | 3 | ||||
-rw-r--r-- | net/decnet/netfilter/dn_rtmsg.c | 3 | ||||
-rw-r--r-- | net/ipv4/fib_frontend.c | 2 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_ULOG.c | 3 | ||||
-rw-r--r-- | net/netfilter/nfnetlink.c | 2 | ||||
-rw-r--r-- | net/netlink/af_netlink.c | 8 | ||||
-rw-r--r-- | net/netlink/genetlink.c | 3 | ||||
-rw-r--r-- | net/xfrm/xfrm_user.c | 2 |
10 files changed, 12 insertions, 19 deletions
diff --git a/net/bridge/netfilter/ebt_ulog.c b/net/bridge/netfilter/ebt_ulog.c index 19063473c71f..3476ec469740 100644 --- a/net/bridge/netfilter/ebt_ulog.c +++ b/net/bridge/netfilter/ebt_ulog.c | |||
@@ -298,8 +298,7 @@ static int __init ebt_ulog_init(void) | |||
298 | spin_lock_init(&ulog_buffers[i].lock); | 298 | spin_lock_init(&ulog_buffers[i].lock); |
299 | } | 299 | } |
300 | 300 | ||
301 | ebtulognl = netlink_kernel_create(&init_net, NETLINK_NFLOG, | 301 | ebtulognl = netlink_kernel_create(&init_net, NETLINK_NFLOG, &cfg); |
302 | THIS_MODULE, &cfg); | ||
303 | if (!ebtulognl) | 302 | if (!ebtulognl) |
304 | ret = -ENOMEM; | 303 | ret = -ENOMEM; |
305 | else if ((ret = xt_register_target(&ebt_ulog_tg_reg)) != 0) | 304 | else if ((ret = xt_register_target(&ebt_ulog_tg_reg)) != 0) |
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index a71806eb9cc6..508c5df4a09c 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -2384,7 +2384,7 @@ static int __net_init rtnetlink_net_init(struct net *net) | |||
2384 | .flags = NL_CFG_F_NONROOT_RECV, | 2384 | .flags = NL_CFG_F_NONROOT_RECV, |
2385 | }; | 2385 | }; |
2386 | 2386 | ||
2387 | sk = netlink_kernel_create(net, NETLINK_ROUTE, THIS_MODULE, &cfg); | 2387 | sk = netlink_kernel_create(net, NETLINK_ROUTE, &cfg); |
2388 | if (!sk) | 2388 | if (!sk) |
2389 | return -ENOMEM; | 2389 | return -ENOMEM; |
2390 | net->rtnl = sk; | 2390 | net->rtnl = sk; |
diff --git a/net/core/sock_diag.c b/net/core/sock_diag.c index 9d8755e4a7a5..602cd637182e 100644 --- a/net/core/sock_diag.c +++ b/net/core/sock_diag.c | |||
@@ -172,8 +172,7 @@ static int __net_init diag_net_init(struct net *net) | |||
172 | .input = sock_diag_rcv, | 172 | .input = sock_diag_rcv, |
173 | }; | 173 | }; |
174 | 174 | ||
175 | net->diag_nlsk = netlink_kernel_create(net, NETLINK_SOCK_DIAG, | 175 | net->diag_nlsk = netlink_kernel_create(net, NETLINK_SOCK_DIAG, &cfg); |
176 | THIS_MODULE, &cfg); | ||
177 | return net->diag_nlsk == NULL ? -ENOMEM : 0; | 176 | return net->diag_nlsk == NULL ? -ENOMEM : 0; |
178 | } | 177 | } |
179 | 178 | ||
diff --git a/net/decnet/netfilter/dn_rtmsg.c b/net/decnet/netfilter/dn_rtmsg.c index 11db0ecf342f..dfe42012a044 100644 --- a/net/decnet/netfilter/dn_rtmsg.c +++ b/net/decnet/netfilter/dn_rtmsg.c | |||
@@ -130,8 +130,7 @@ static int __init dn_rtmsg_init(void) | |||
130 | .input = dnrmg_receive_user_skb, | 130 | .input = dnrmg_receive_user_skb, |
131 | }; | 131 | }; |
132 | 132 | ||
133 | dnrmg = netlink_kernel_create(&init_net, | 133 | dnrmg = netlink_kernel_create(&init_net, NETLINK_DNRTMSG, &cfg); |
134 | NETLINK_DNRTMSG, THIS_MODULE, &cfg); | ||
135 | if (dnrmg == NULL) { | 134 | if (dnrmg == NULL) { |
136 | printk(KERN_ERR "dn_rtmsg: Cannot create netlink socket"); | 135 | printk(KERN_ERR "dn_rtmsg: Cannot create netlink socket"); |
137 | return -ENOMEM; | 136 | return -ENOMEM; |
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 8a7cd795a96e..dc1f10ed1872 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c | |||
@@ -986,7 +986,7 @@ static int __net_init nl_fib_lookup_init(struct net *net) | |||
986 | .input = nl_fib_input, | 986 | .input = nl_fib_input, |
987 | }; | 987 | }; |
988 | 988 | ||
989 | sk = netlink_kernel_create(net, NETLINK_FIB_LOOKUP, THIS_MODULE, &cfg); | 989 | sk = netlink_kernel_create(net, NETLINK_FIB_LOOKUP, &cfg); |
990 | if (sk == NULL) | 990 | if (sk == NULL) |
991 | return -EAFNOSUPPORT; | 991 | return -EAFNOSUPPORT; |
992 | net->ipv4.fibnl = sk; | 992 | net->ipv4.fibnl = sk; |
diff --git a/net/ipv4/netfilter/ipt_ULOG.c b/net/ipv4/netfilter/ipt_ULOG.c index 1109f7f6c254..b5ef3cba2250 100644 --- a/net/ipv4/netfilter/ipt_ULOG.c +++ b/net/ipv4/netfilter/ipt_ULOG.c | |||
@@ -396,8 +396,7 @@ static int __init ulog_tg_init(void) | |||
396 | for (i = 0; i < ULOG_MAXNLGROUPS; i++) | 396 | for (i = 0; i < ULOG_MAXNLGROUPS; i++) |
397 | setup_timer(&ulog_buffers[i].timer, ulog_timer, i); | 397 | setup_timer(&ulog_buffers[i].timer, ulog_timer, i); |
398 | 398 | ||
399 | nflognl = netlink_kernel_create(&init_net, NETLINK_NFLOG, | 399 | nflognl = netlink_kernel_create(&init_net, NETLINK_NFLOG, &cfg); |
400 | THIS_MODULE, &cfg); | ||
401 | if (!nflognl) | 400 | if (!nflognl) |
402 | return -ENOMEM; | 401 | return -ENOMEM; |
403 | 402 | ||
diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c index a26503342e71..ffb92c03a358 100644 --- a/net/netfilter/nfnetlink.c +++ b/net/netfilter/nfnetlink.c | |||
@@ -241,7 +241,7 @@ static int __net_init nfnetlink_net_init(struct net *net) | |||
241 | #endif | 241 | #endif |
242 | }; | 242 | }; |
243 | 243 | ||
244 | nfnl = netlink_kernel_create(net, NETLINK_NETFILTER, THIS_MODULE, &cfg); | 244 | nfnl = netlink_kernel_create(net, NETLINK_NETFILTER, &cfg); |
245 | if (!nfnl) | 245 | if (!nfnl) |
246 | return -ENOMEM; | 246 | return -ENOMEM; |
247 | net->nfnl_stash = nfnl; | 247 | net->nfnl_stash = nfnl; |
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index b74540ce3c14..4d348e97e131 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
@@ -1526,9 +1526,8 @@ static void netlink_data_ready(struct sock *sk, int len) | |||
1526 | */ | 1526 | */ |
1527 | 1527 | ||
1528 | struct sock * | 1528 | struct sock * |
1529 | netlink_kernel_create(struct net *net, int unit, | 1529 | __netlink_kernel_create(struct net *net, int unit, struct module *module, |
1530 | struct module *module, | 1530 | struct netlink_kernel_cfg *cfg) |
1531 | struct netlink_kernel_cfg *cfg) | ||
1532 | { | 1531 | { |
1533 | struct socket *sock; | 1532 | struct socket *sock; |
1534 | struct sock *sk; | 1533 | struct sock *sk; |
@@ -1603,8 +1602,7 @@ out_sock_release_nosk: | |||
1603 | sock_release(sock); | 1602 | sock_release(sock); |
1604 | return NULL; | 1603 | return NULL; |
1605 | } | 1604 | } |
1606 | EXPORT_SYMBOL(netlink_kernel_create); | 1605 | EXPORT_SYMBOL(__netlink_kernel_create); |
1607 | |||
1608 | 1606 | ||
1609 | void | 1607 | void |
1610 | netlink_kernel_release(struct sock *sk) | 1608 | netlink_kernel_release(struct sock *sk) |
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index c1b71aef9f71..19288b7d6135 100644 --- a/net/netlink/genetlink.c +++ b/net/netlink/genetlink.c | |||
@@ -922,8 +922,7 @@ static int __net_init genl_pernet_init(struct net *net) | |||
922 | }; | 922 | }; |
923 | 923 | ||
924 | /* we'll bump the group number right afterwards */ | 924 | /* we'll bump the group number right afterwards */ |
925 | net->genl_sock = netlink_kernel_create(net, NETLINK_GENERIC, | 925 | net->genl_sock = netlink_kernel_create(net, NETLINK_GENERIC, &cfg); |
926 | THIS_MODULE, &cfg); | ||
927 | 926 | ||
928 | if (!net->genl_sock && net_eq(net, &init_net)) | 927 | if (!net->genl_sock && net_eq(net, &init_net)) |
929 | panic("GENL: Cannot initialize generic netlink\n"); | 928 | panic("GENL: Cannot initialize generic netlink\n"); |
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index ab58034c42d6..354070adb5ef 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -2963,7 +2963,7 @@ static int __net_init xfrm_user_net_init(struct net *net) | |||
2963 | .input = xfrm_netlink_rcv, | 2963 | .input = xfrm_netlink_rcv, |
2964 | }; | 2964 | }; |
2965 | 2965 | ||
2966 | nlsk = netlink_kernel_create(net, NETLINK_XFRM, THIS_MODULE, &cfg); | 2966 | nlsk = netlink_kernel_create(net, NETLINK_XFRM, &cfg); |
2967 | if (nlsk == NULL) | 2967 | if (nlsk == NULL) |
2968 | return -ENOMEM; | 2968 | return -ENOMEM; |
2969 | net->xfrm.nlsk_stash = nlsk; /* Don't set to NULL */ | 2969 | net->xfrm.nlsk_stash = nlsk; /* Don't set to NULL */ |