Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -809,14 +809,12 @@ static int refresh_signalling_expectation(struct nf_conn *ct,
		    exp->tuple.dst.protonum != proto ||
		    exp->tuple.dst.u.udp.port != port)
			continue;
		if (!del_timer(&exp->timeout))
			continue;
		if (mod_timer_pending(&exp->timeout, jiffies + expires * HZ)) {
			exp->flags &= ~NF_CT_EXPECT_INACTIVE;
		exp->timeout.expires = jiffies + expires * HZ;
		add_timer(&exp->timeout);
			found = 1;
			break;
		}
	}
	spin_unlock_bh(&nf_conntrack_expect_lock);
	return found;
}