Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 377433
b: refs/heads/master
c: c8fc51c
h: refs/heads/master
i:
  377431: d7e70fa
v: v3
  • Loading branch information
Gao feng authored and Pablo Neira Ayuso committed Jun 24, 2013
1 parent ed0a576 commit 24b2f59
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 797a7d66d2048fe8a4ac1ba58c5d4752d64b1ac4
refs/heads/master: c8fc51cfa758be945c6113a4b446e0159070f768
12 changes: 8 additions & 4 deletions trunk/net/ipv4/netfilter/ipt_ULOG.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,16 @@ static void ulog_send(struct ulog_net *ulog, unsigned int nlgroupnum)
/* timer function to flush queue in flushtimeout time */
static void ulog_timer(unsigned long data)
{
unsigned int groupnum = *((unsigned int *)data);
struct ulog_net *ulog = container_of((void *)data,
struct ulog_net,
nlgroup[*(unsigned int *)data]);
nlgroup[groupnum]);
pr_debug("timer function called, calling ulog_send\n");

/* lock to protect against somebody modifying our structure
* from ipt_ulog_target at the same time */
spin_lock_bh(&ulog->lock);
ulog_send(ulog, data);
ulog_send(ulog, groupnum);
spin_unlock_bh(&ulog->lock);
}

Expand Down Expand Up @@ -407,8 +408,11 @@ static int __net_init ulog_tg_net_init(struct net *net)

spin_lock_init(&ulog->lock);
/* initialize ulog_buffers */
for (i = 0; i < ULOG_MAXNLGROUPS; i++)
setup_timer(&ulog->ulog_buffers[i].timer, ulog_timer, i);
for (i = 0; i < ULOG_MAXNLGROUPS; i++) {
ulog->nlgroup[i] = i;
setup_timer(&ulog->ulog_buffers[i].timer, ulog_timer,
(unsigned long)&ulog->nlgroup[i]);
}

ulog->nflognl = netlink_kernel_create(net, NETLINK_NFLOG, &cfg);
if (!ulog->nflognl)
Expand Down

0 comments on commit 24b2f59

Please sign in to comment.