diff options
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/netfilter/ipt_ULOG.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/net/ipv4/netfilter/ipt_ULOG.c b/net/ipv4/netfilter/ipt_ULOG.c index ff4b781b1056..32b0e978c8e0 100644 --- a/net/ipv4/netfilter/ipt_ULOG.c +++ b/net/ipv4/netfilter/ipt_ULOG.c | |||
@@ -125,15 +125,16 @@ static void ulog_send(struct ulog_net *ulog, unsigned int nlgroupnum) | |||
125 | /* timer function to flush queue in flushtimeout time */ | 125 | /* timer function to flush queue in flushtimeout time */ |
126 | static void ulog_timer(unsigned long data) | 126 | static void ulog_timer(unsigned long data) |
127 | { | 127 | { |
128 | unsigned int groupnum = *((unsigned int *)data); | ||
128 | struct ulog_net *ulog = container_of((void *)data, | 129 | struct ulog_net *ulog = container_of((void *)data, |
129 | struct ulog_net, | 130 | struct ulog_net, |
130 | nlgroup[*(unsigned int *)data]); | 131 | nlgroup[groupnum]); |
131 | pr_debug("timer function called, calling ulog_send\n"); | 132 | pr_debug("timer function called, calling ulog_send\n"); |
132 | 133 | ||
133 | /* lock to protect against somebody modifying our structure | 134 | /* lock to protect against somebody modifying our structure |
134 | * from ipt_ulog_target at the same time */ | 135 | * from ipt_ulog_target at the same time */ |
135 | spin_lock_bh(&ulog->lock); | 136 | spin_lock_bh(&ulog->lock); |
136 | ulog_send(ulog, data); | 137 | ulog_send(ulog, groupnum); |
137 | spin_unlock_bh(&ulog->lock); | 138 | spin_unlock_bh(&ulog->lock); |
138 | } | 139 | } |
139 | 140 | ||
@@ -407,8 +408,11 @@ static int __net_init ulog_tg_net_init(struct net *net) | |||
407 | 408 | ||
408 | spin_lock_init(&ulog->lock); | 409 | spin_lock_init(&ulog->lock); |
409 | /* initialize ulog_buffers */ | 410 | /* initialize ulog_buffers */ |
410 | for (i = 0; i < ULOG_MAXNLGROUPS; i++) | 411 | for (i = 0; i < ULOG_MAXNLGROUPS; i++) { |
411 | setup_timer(&ulog->ulog_buffers[i].timer, ulog_timer, i); | 412 | ulog->nlgroup[i] = i; |
413 | setup_timer(&ulog->ulog_buffers[i].timer, ulog_timer, | ||
414 | (unsigned long)&ulog->nlgroup[i]); | ||
415 | } | ||
412 | 416 | ||
413 | ulog->nflognl = netlink_kernel_create(net, NETLINK_NFLOG, &cfg); | 417 | ulog->nflognl = netlink_kernel_create(net, NETLINK_NFLOG, &cfg); |
414 | if (!ulog->nflognl) | 418 | if (!ulog->nflognl) |