aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/netfilter/nf_conntrack_core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index 4a2cce1e1ced..120588333c73 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -420,7 +420,7 @@ EXPORT_SYMBOL_GPL(nf_conntrack_tuple_taken);
420 420
421/* There's a small race here where we may free a just-assured 421/* There's a small race here where we may free a just-assured
422 connection. Too bad: we're in trouble anyway. */ 422 connection. Too bad: we're in trouble anyway. */
423static int early_drop(unsigned int hash) 423static noinline int early_drop(unsigned int hash)
424{ 424{
425 /* Use oldest entry, which is roughly LRU */ 425 /* Use oldest entry, which is roughly LRU */
426 struct nf_conntrack_tuple_hash *h; 426 struct nf_conntrack_tuple_hash *h;
@@ -472,8 +472,8 @@ struct nf_conn *nf_conntrack_alloc(const struct nf_conntrack_tuple *orig,
472 /* We don't want any race condition at early drop stage */ 472 /* We don't want any race condition at early drop stage */
473 atomic_inc(&nf_conntrack_count); 473 atomic_inc(&nf_conntrack_count);
474 474
475 if (nf_conntrack_max 475 if (nf_conntrack_max &&
476 && atomic_read(&nf_conntrack_count) > nf_conntrack_max) { 476 unlikely(atomic_read(&nf_conntrack_count) > nf_conntrack_max)) {
477 unsigned int hash = hash_conntrack(orig); 477 unsigned int hash = hash_conntrack(orig);
478 if (!early_drop(hash)) { 478 if (!early_drop(hash)) {
479 atomic_dec(&nf_conntrack_count); 479 atomic_dec(&nf_conntrack_count);