diff options
| -rw-r--r-- | net/netfilter/nf_nat_core.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/net/netfilter/nf_nat_core.c b/net/netfilter/nf_nat_core.c index 832c5a08d9a5..eb541786ccb7 100644 --- a/net/netfilter/nf_nat_core.c +++ b/net/netfilter/nf_nat_core.c | |||
| @@ -222,20 +222,21 @@ find_appropriate_src(struct net *net, | |||
| 222 | .tuple = tuple, | 222 | .tuple = tuple, |
| 223 | .zone = zone | 223 | .zone = zone |
| 224 | }; | 224 | }; |
| 225 | struct rhlist_head *hl; | 225 | struct rhlist_head *hl, *h; |
| 226 | 226 | ||
| 227 | hl = rhltable_lookup(&nf_nat_bysource_table, &key, | 227 | hl = rhltable_lookup(&nf_nat_bysource_table, &key, |
| 228 | nf_nat_bysource_params); | 228 | nf_nat_bysource_params); |
| 229 | if (!hl) | ||
| 230 | return 0; | ||
| 231 | 229 | ||
| 232 | ct = container_of(hl, typeof(*ct), nat_bysource); | 230 | rhl_for_each_entry_rcu(ct, h, hl, nat_bysource) { |
| 231 | nf_ct_invert_tuplepr(result, | ||
| 232 | &ct->tuplehash[IP_CT_DIR_REPLY].tuple); | ||
| 233 | result->dst = tuple->dst; | ||
| 233 | 234 | ||
| 234 | nf_ct_invert_tuplepr(result, | 235 | if (in_range(l3proto, l4proto, result, range)) |
| 235 | &ct->tuplehash[IP_CT_DIR_REPLY].tuple); | 236 | return 1; |
| 236 | result->dst = tuple->dst; | 237 | } |
| 237 | 238 | ||
| 238 | return in_range(l3proto, l4proto, result, range); | 239 | return 0; |
| 239 | } | 240 | } |
| 240 | 241 | ||
| 241 | /* For [FUTURE] fragmentation handling, we want the least-used | 242 | /* For [FUTURE] fragmentation handling, we want the least-used |
