summaryrefslogtreecommitdiff
path: root/src/sync-ftfw.c
diff options
context:
space:
mode:
author/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org>2008-01-15 12:50:37 +0000
committer/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org>2008-01-15 12:50:37 +0000
commitb861a707522e8625b4a5b4145b97a8825037572f (patch)
tree99c8e48bc690579af3177a6fb4f375f464dfa0bc /src/sync-ftfw.c
parent41f3e135db165fff931a07ef79e7731037d22941 (diff)
downloadconntrack-tools-b861a707522e8625b4a5b4145b97a8825037572f.tar.gz
conntrack-tools-b861a707522e8625b4a5b4145b97a8825037572f.zip
Max Kellermann <max@duempel.org>
Use list_for_each_entry() instead of list_for_each()
Diffstat (limited to 'src/sync-ftfw.c')
-rw-r--r--src/sync-ftfw.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/sync-ftfw.c b/src/sync-ftfw.c
index 23095c4..8452e2e 100644
--- a/src/sync-ftfw.c
+++ b/src/sync-ftfw.c
@@ -185,11 +185,9 @@ static int rs_queue_empty(void *data1, void *data2)
static void rs_list_to_tx(struct cache *c, unsigned int from, unsigned int to)
{
- struct list_head *n;
- struct us_conntrack *u;
+ struct cache_ftfw *cn;
- list_for_each(n, &rs_list) {
- struct cache_ftfw *cn = (struct cache_ftfw *) n;
+ list_for_each_entry(cn, &rs_list, rs_list) {
struct us_conntrack *u;
u = cache_get_conntrack(STATE_SYNC(internal), cn);
@@ -203,10 +201,9 @@ static void rs_list_to_tx(struct cache *c, unsigned int from, unsigned int to)
static void rs_list_empty(struct cache *c, unsigned int from, unsigned int to)
{
- struct list_head *n, *tmp;
+ struct cache_ftfw *cn, *tmp;
- list_for_each_safe(n, tmp, &rs_list) {
- struct cache_ftfw *cn = (struct cache_ftfw *) n;
+ list_for_each_entry_safe(cn, tmp, &rs_list, rs_list) {
struct us_conntrack *u;
u = cache_get_conntrack(STATE_SYNC(internal), cn);
@@ -337,19 +334,17 @@ static int tx_list_xmit(struct list_head *i, struct us_conntrack *u)
static void ftfw_run()
{
- struct list_head *i, *tmp;
+ struct cache_ftfw *cn, *tmp;
/* send messages in the tx_queue */
queue_iterate(tx_queue, NULL, tx_queue_xmit);
/* send conntracks in the tx_list */
- list_for_each_safe(i, tmp, &tx_list) {
- struct cache_ftfw *cn;
+ list_for_each_entry_safe(cn, tmp, &tx_list, tx_list) {
struct us_conntrack *u;
- cn = container_of(i, struct cache_ftfw, tx_list);
u = cache_get_conntrack(STATE_SYNC(internal), cn);
- tx_list_xmit(i, u);
+ tx_list_xmit(&cn->tx_list, u);
}
mod_alarm(&alive_alarm, 1, 0);