Commit f4d9b3c6 authored by Harald Welte's avatar Harald Welte Committed by Linus Torvalds

[NETFILTER]: Locking optimization in ip_conntrack_core

A: Pablo Neira
D: This patch puts tightens up a lock protected section in
D: ip_ct_refresh()
parent 6a9378b5
......@@ -1158,18 +1158,18 @@ void ip_ct_refresh(struct ip_conntrack *ct, unsigned long extra_jiffies)
{
IP_NF_ASSERT(ct->timeout.data == (unsigned long)ct);
WRITE_LOCK(&ip_conntrack_lock);
/* If not in hash table, timer will not be active yet */
if (!is_confirmed(ct))
ct->timeout.expires = extra_jiffies;
else {
WRITE_LOCK(&ip_conntrack_lock);
/* Need del_timer for race avoidance (may already be dying). */
if (del_timer(&ct->timeout)) {
ct->timeout.expires = jiffies + extra_jiffies;
add_timer(&ct->timeout);
}
WRITE_UNLOCK(&ip_conntrack_lock);
}
WRITE_UNLOCK(&ip_conntrack_lock);
}
/* Returns new sk_buff, or NULL */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment