netfilter: Let nf_ct_kill() callers know if del_timer() returned true.

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller 2008-07-14 20:22:38 -07:00
Родитель 79d16385c7
Коммит 4c88949800
2 изменённых файлов: 18 добавлений и 15 удалений

Просмотреть файл

@ -223,23 +223,23 @@ static inline void nf_ct_refresh(struct nf_conn *ct,
__nf_ct_refresh_acct(ct, 0, skb, extra_jiffies, 0); __nf_ct_refresh_acct(ct, 0, skb, extra_jiffies, 0);
} }
extern void __nf_ct_kill_acct(struct nf_conn *ct, extern bool __nf_ct_kill_acct(struct nf_conn *ct,
enum ip_conntrack_info ctinfo, enum ip_conntrack_info ctinfo,
const struct sk_buff *skb, const struct sk_buff *skb,
int do_acct); int do_acct);
/* kill conntrack and do accounting */ /* kill conntrack and do accounting */
static inline void nf_ct_kill_acct(struct nf_conn *ct, static inline bool nf_ct_kill_acct(struct nf_conn *ct,
enum ip_conntrack_info ctinfo, enum ip_conntrack_info ctinfo,
const struct sk_buff *skb) const struct sk_buff *skb)
{ {
__nf_ct_kill_acct(ct, ctinfo, skb, 1); return __nf_ct_kill_acct(ct, ctinfo, skb, 1);
} }
/* kill conntrack without accounting */ /* kill conntrack without accounting */
static inline void nf_ct_kill(struct nf_conn *ct) static inline bool nf_ct_kill(struct nf_conn *ct)
{ {
__nf_ct_kill_acct(ct, 0, NULL, 0); return __nf_ct_kill_acct(ct, 0, NULL, 0);
} }
/* These are for NAT. Icky. */ /* These are for NAT. Icky. */

Просмотреть файл

@ -848,10 +848,10 @@ acct:
} }
EXPORT_SYMBOL_GPL(__nf_ct_refresh_acct); EXPORT_SYMBOL_GPL(__nf_ct_refresh_acct);
void __nf_ct_kill_acct(struct nf_conn *ct, bool __nf_ct_kill_acct(struct nf_conn *ct,
enum ip_conntrack_info ctinfo, enum ip_conntrack_info ctinfo,
const struct sk_buff *skb, const struct sk_buff *skb,
int do_acct) int do_acct)
{ {
#ifdef CONFIG_NF_CT_ACCT #ifdef CONFIG_NF_CT_ACCT
if (do_acct) { if (do_acct) {
@ -862,8 +862,11 @@ void __nf_ct_kill_acct(struct nf_conn *ct,
spin_unlock_bh(&nf_conntrack_lock); spin_unlock_bh(&nf_conntrack_lock);
} }
#endif #endif
if (del_timer(&ct->timeout)) if (del_timer(&ct->timeout)) {
ct->timeout.function((unsigned long)ct); ct->timeout.function((unsigned long)ct);
return true;
}
return false;
} }
EXPORT_SYMBOL_GPL(__nf_ct_kill_acct); EXPORT_SYMBOL_GPL(__nf_ct_kill_acct);