Commit a96e66e7 authored by Gao Feng's avatar Gao Feng Committed by Pablo Neira Ayuso

netfilter: nf_ct_sip: Use mod_timer_pending()

timer_del() followed by timer_add() can be replaced by
mod_timer_pending().
Signed-off-by: default avatarGao Feng <fgao@ikuai8.com>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 935b7f64
...@@ -809,13 +809,11 @@ static int refresh_signalling_expectation(struct nf_conn *ct, ...@@ -809,13 +809,11 @@ static int refresh_signalling_expectation(struct nf_conn *ct,
exp->tuple.dst.protonum != proto || exp->tuple.dst.protonum != proto ||
exp->tuple.dst.u.udp.port != port) exp->tuple.dst.u.udp.port != port)
continue; continue;
if (!del_timer(&exp->timeout)) if (mod_timer_pending(&exp->timeout, jiffies + expires * HZ)) {
continue; exp->flags &= ~NF_CT_EXPECT_INACTIVE;
exp->flags &= ~NF_CT_EXPECT_INACTIVE; found = 1;
exp->timeout.expires = jiffies + expires * HZ; break;
add_timer(&exp->timeout); }
found = 1;
break;
} }
spin_unlock_bh(&nf_conntrack_expect_lock); spin_unlock_bh(&nf_conntrack_expect_lock);
return found; return found;
......
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