diff options
author | David S. Miller <davem@davemloft.net> | 2010-02-24 21:23:37 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-24 21:23:37 -0500 |
commit | 54831a83bfe656c4c54e287c734c6b0ccaa3719b (patch) | |
tree | abd5bef16d1a6011f629a36d4e245a2ed4f3df3c /net/netfilter | |
parent | fb977e2ca607a7e74946a1de798f474d1b80b9d6 (diff) | |
parent | 0f234214d15fa914436d304ecf5c3e43449e79f9 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/xt_TCPMSS.c | 12 | ||||
-rw-r--r-- | net/netfilter/xt_recent.c | 4 |
2 files changed, 10 insertions, 6 deletions
diff --git a/net/netfilter/xt_TCPMSS.c b/net/netfilter/xt_TCPMSS.c index 6f21b4377db..0e357ac9a2a 100644 --- a/net/netfilter/xt_TCPMSS.c +++ b/net/netfilter/xt_TCPMSS.c | |||
@@ -239,6 +239,7 @@ static bool tcpmss_tg4_check(const struct xt_tgchk_param *par) | |||
239 | { | 239 | { |
240 | const struct xt_tcpmss_info *info = par->targinfo; | 240 | const struct xt_tcpmss_info *info = par->targinfo; |
241 | const struct ipt_entry *e = par->entryinfo; | 241 | const struct ipt_entry *e = par->entryinfo; |
242 | const struct xt_entry_match *ematch; | ||
242 | 243 | ||
243 | if (info->mss == XT_TCPMSS_CLAMP_PMTU && | 244 | if (info->mss == XT_TCPMSS_CLAMP_PMTU && |
244 | (par->hook_mask & ~((1 << NF_INET_FORWARD) | | 245 | (par->hook_mask & ~((1 << NF_INET_FORWARD) | |
@@ -248,8 +249,9 @@ static bool tcpmss_tg4_check(const struct xt_tgchk_param *par) | |||
248 | "FORWARD, OUTPUT and POSTROUTING hooks\n"); | 249 | "FORWARD, OUTPUT and POSTROUTING hooks\n"); |
249 | return false; | 250 | return false; |
250 | } | 251 | } |
251 | if (IPT_MATCH_ITERATE(e, find_syn_match)) | 252 | xt_ematch_foreach(ematch, e) |
252 | return true; | 253 | if (find_syn_match(ematch)) |
254 | return true; | ||
253 | printk("xt_TCPMSS: Only works on TCP SYN packets\n"); | 255 | printk("xt_TCPMSS: Only works on TCP SYN packets\n"); |
254 | return false; | 256 | return false; |
255 | } | 257 | } |
@@ -259,6 +261,7 @@ static bool tcpmss_tg6_check(const struct xt_tgchk_param *par) | |||
259 | { | 261 | { |
260 | const struct xt_tcpmss_info *info = par->targinfo; | 262 | const struct xt_tcpmss_info *info = par->targinfo; |
261 | const struct ip6t_entry *e = par->entryinfo; | 263 | const struct ip6t_entry *e = par->entryinfo; |
264 | const struct xt_entry_match *ematch; | ||
262 | 265 | ||
263 | if (info->mss == XT_TCPMSS_CLAMP_PMTU && | 266 | if (info->mss == XT_TCPMSS_CLAMP_PMTU && |
264 | (par->hook_mask & ~((1 << NF_INET_FORWARD) | | 267 | (par->hook_mask & ~((1 << NF_INET_FORWARD) | |
@@ -268,8 +271,9 @@ static bool tcpmss_tg6_check(const struct xt_tgchk_param *par) | |||
268 | "FORWARD, OUTPUT and POSTROUTING hooks\n"); | 271 | "FORWARD, OUTPUT and POSTROUTING hooks\n"); |
269 | return false; | 272 | return false; |
270 | } | 273 | } |
271 | if (IP6T_MATCH_ITERATE(e, find_syn_match)) | 274 | xt_ematch_foreach(ematch, e) |
272 | return true; | 275 | if (find_syn_match(ematch)) |
276 | return true; | ||
273 | printk("xt_TCPMSS: Only works on TCP SYN packets\n"); | 277 | printk("xt_TCPMSS: Only works on TCP SYN packets\n"); |
274 | return false; | 278 | return false; |
275 | } | 279 | } |
diff --git a/net/netfilter/xt_recent.c b/net/netfilter/xt_recent.c index 132cfaa84cd..7073dbb8100 100644 --- a/net/netfilter/xt_recent.c +++ b/net/netfilter/xt_recent.c | |||
@@ -177,10 +177,10 @@ recent_entry_init(struct recent_table *t, const union nf_inet_addr *addr, | |||
177 | 177 | ||
178 | static void recent_entry_update(struct recent_table *t, struct recent_entry *e) | 178 | static void recent_entry_update(struct recent_table *t, struct recent_entry *e) |
179 | { | 179 | { |
180 | e->index %= ip_pkt_list_tot; | ||
180 | e->stamps[e->index++] = jiffies; | 181 | e->stamps[e->index++] = jiffies; |
181 | if (e->index > e->nstamps) | 182 | if (e->index > e->nstamps) |
182 | e->nstamps = e->index; | 183 | e->nstamps = e->index; |
183 | e->index %= ip_pkt_list_tot; | ||
184 | list_move_tail(&e->lru_list, &t->lru_list); | 184 | list_move_tail(&e->lru_list, &t->lru_list); |
185 | } | 185 | } |
186 | 186 | ||
@@ -267,7 +267,7 @@ recent_mt(const struct sk_buff *skb, const struct xt_match_param *par) | |||
267 | for (i = 0; i < e->nstamps; i++) { | 267 | for (i = 0; i < e->nstamps; i++) { |
268 | if (info->seconds && time_after(time, e->stamps[i])) | 268 | if (info->seconds && time_after(time, e->stamps[i])) |
269 | continue; | 269 | continue; |
270 | if (++hits >= info->hit_count) { | 270 | if (info->hit_count && ++hits >= info->hit_count) { |
271 | ret = !ret; | 271 | ret = !ret; |
272 | break; | 272 | break; |
273 | } | 273 | } |