diff options
-rw-r--r-- | net/ipv4/netfilter/ipt_CLUSTERIP.c | 6 | ||||
-rw-r--r-- | net/netfilter/core.c | 8 |
2 files changed, 6 insertions, 8 deletions
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c index 2f544dac72df..311361e1272c 100644 --- a/net/ipv4/netfilter/ipt_CLUSTERIP.c +++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c | |||
@@ -109,11 +109,9 @@ clusterip_config_entry_put(struct clusterip_config *c) | |||
109 | static struct clusterip_config * | 109 | static struct clusterip_config * |
110 | __clusterip_config_find(__be32 clusterip) | 110 | __clusterip_config_find(__be32 clusterip) |
111 | { | 111 | { |
112 | struct list_head *pos; | 112 | struct clusterip_config *c; |
113 | 113 | ||
114 | list_for_each(pos, &clusterip_configs) { | 114 | list_for_each_entry(c, &clusterip_configs, list) { |
115 | struct clusterip_config *c = list_entry(pos, | ||
116 | struct clusterip_config, list); | ||
117 | if (c->clusterip == clusterip) | 115 | if (c->clusterip == clusterip) |
118 | return c; | 116 | return c; |
119 | } | 117 | } |
diff --git a/net/netfilter/core.c b/net/netfilter/core.c index 631d26948314..e6d3a69b9e9b 100644 --- a/net/netfilter/core.c +++ b/net/netfilter/core.c | |||
@@ -62,17 +62,17 @@ static DEFINE_MUTEX(nf_hook_mutex); | |||
62 | 62 | ||
63 | int nf_register_hook(struct nf_hook_ops *reg) | 63 | int nf_register_hook(struct nf_hook_ops *reg) |
64 | { | 64 | { |
65 | struct list_head *i; | 65 | struct nf_hook_ops *elem; |
66 | int err; | 66 | int err; |
67 | 67 | ||
68 | err = mutex_lock_interruptible(&nf_hook_mutex); | 68 | err = mutex_lock_interruptible(&nf_hook_mutex); |
69 | if (err < 0) | 69 | if (err < 0) |
70 | return err; | 70 | return err; |
71 | list_for_each(i, &nf_hooks[reg->pf][reg->hooknum]) { | 71 | list_for_each_entry(elem, &nf_hooks[reg->pf][reg->hooknum], list) { |
72 | if (reg->priority < ((struct nf_hook_ops *)i)->priority) | 72 | if (reg->priority < elem->priority) |
73 | break; | 73 | break; |
74 | } | 74 | } |
75 | list_add_rcu(®->list, i->prev); | 75 | list_add_rcu(®->list, elem->list.prev); |
76 | mutex_unlock(&nf_hook_mutex); | 76 | mutex_unlock(&nf_hook_mutex); |
77 | return 0; | 77 | return 0; |
78 | } | 78 | } |