aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge
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/bridge
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/bridge')
-rw-r--r--net/bridge/netfilter/ebt_ulog.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/bridge/netfilter/ebt_ulog.c b/net/bridge/netfilter/ebt_ulog.c
index 1bd173218f7b..374bdcd77039 100644
--- a/net/bridge/netfilter/ebt_ulog.c
+++ b/net/bridge/netfilter/ebt_ulog.c
@@ -282,6 +282,9 @@ static int __init ebt_ulog_init(void)
282{ 282{
283 int ret; 283 int ret;
284 int i; 284 int i;
285 struct netlink_kernel_cfg cfg = {
286 .groups = EBT_ULOG_MAXNLGROUPS,
287 };
285 288
286 if (nlbufsiz >= 128*1024) { 289 if (nlbufsiz >= 128*1024) {
287 pr_warning("Netlink buffer has to be <= 128kB," 290 pr_warning("Netlink buffer has to be <= 128kB,"
@@ -296,8 +299,7 @@ static int __init ebt_ulog_init(void)
296 } 299 }
297 300
298 ebtulognl = netlink_kernel_create(&init_net, NETLINK_NFLOG, 301 ebtulognl = netlink_kernel_create(&init_net, NETLINK_NFLOG,
299 EBT_ULOG_MAXNLGROUPS, NULL, NULL, 302 THIS_MODULE, &cfg);
300 THIS_MODULE);
301 if (!ebtulognl) 303 if (!ebtulognl)
302 ret = -ENOMEM; 304 ret = -ENOMEM;
303 else if ((ret = xt_register_target(&ebt_ulog_tg_reg)) != 0) 305 else if ((ret = xt_register_target(&ebt_ulog_tg_reg)) != 0)