diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/netfilter/nf_conntrack_core.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index 7c9ec3dee96e..8e572d7c08c5 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c | |||
@@ -511,11 +511,17 @@ static noinline int early_drop(struct net *net, unsigned int hash) | |||
511 | cnt++; | 511 | cnt++; |
512 | } | 512 | } |
513 | 513 | ||
514 | if (ct && unlikely(nf_ct_is_dying(ct) || | 514 | if (ct != NULL) { |
515 | !atomic_inc_not_zero(&ct->ct_general.use))) | 515 | if (likely(!nf_ct_is_dying(ct) && |
516 | ct = NULL; | 516 | atomic_inc_not_zero(&ct->ct_general.use))) |
517 | if (ct || cnt >= NF_CT_EVICTION_RANGE) | 517 | break; |
518 | else | ||
519 | ct = NULL; | ||
520 | } | ||
521 | |||
522 | if (cnt >= NF_CT_EVICTION_RANGE) | ||
518 | break; | 523 | break; |
524 | |||
519 | hash = (hash + 1) % nf_conntrack_htable_size; | 525 | hash = (hash + 1) % nf_conntrack_htable_size; |
520 | } | 526 | } |
521 | rcu_read_unlock(); | 527 | rcu_read_unlock(); |