diff options
author | David S. Miller <davem@davemloft.net> | 2008-07-14 23:22:38 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-14 23:22:38 -0400 |
commit | 4c8894980010536915c4f5513ee180e3614aeca9 (patch) | |
tree | 07022bfc68eadc372df16adcb98aff2fa044fddd | |
parent | 79d16385c7f287a33ea771c4dbe60ae43f791b49 (diff) |
netfilter: Let nf_ct_kill() callers know if del_timer() returned true.
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/netfilter/nf_conntrack.h | 20 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_core.c | 13 |
2 files changed, 18 insertions, 15 deletions
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index d5d76ec7abb0..8f5b75734dd0 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
@@ -223,23 +223,23 @@ static inline void nf_ct_refresh(struct nf_conn *ct, | |||
223 | __nf_ct_refresh_acct(ct, 0, skb, extra_jiffies, 0); | 223 | __nf_ct_refresh_acct(ct, 0, skb, extra_jiffies, 0); |
224 | } | 224 | } |
225 | 225 | ||
226 | extern void __nf_ct_kill_acct(struct nf_conn *ct, | 226 | extern bool __nf_ct_kill_acct(struct nf_conn *ct, |
227 | enum ip_conntrack_info ctinfo, | 227 | enum ip_conntrack_info ctinfo, |
228 | const struct sk_buff *skb, | 228 | const struct sk_buff *skb, |
229 | int do_acct); | 229 | int do_acct); |
230 | 230 | ||
231 | /* kill conntrack and do accounting */ | 231 | /* kill conntrack and do accounting */ |
232 | static inline void nf_ct_kill_acct(struct nf_conn *ct, | 232 | static inline bool nf_ct_kill_acct(struct nf_conn *ct, |
233 | enum ip_conntrack_info ctinfo, | 233 | enum ip_conntrack_info ctinfo, |
234 | const struct sk_buff *skb) | 234 | const struct sk_buff *skb) |
235 | { | 235 | { |
236 | __nf_ct_kill_acct(ct, ctinfo, skb, 1); | 236 | return __nf_ct_kill_acct(ct, ctinfo, skb, 1); |
237 | } | 237 | } |
238 | 238 | ||
239 | /* kill conntrack without accounting */ | 239 | /* kill conntrack without accounting */ |
240 | static inline void nf_ct_kill(struct nf_conn *ct) | 240 | static inline bool nf_ct_kill(struct nf_conn *ct) |
241 | { | 241 | { |
242 | __nf_ct_kill_acct(ct, 0, NULL, 0); | 242 | return __nf_ct_kill_acct(ct, 0, NULL, 0); |
243 | } | 243 | } |
244 | 244 | ||
245 | /* These are for NAT. Icky. */ | 245 | /* These are for NAT. Icky. */ |
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index 212a0888408d..28d03e64200b 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c | |||
@@ -848,10 +848,10 @@ acct: | |||
848 | } | 848 | } |
849 | EXPORT_SYMBOL_GPL(__nf_ct_refresh_acct); | 849 | EXPORT_SYMBOL_GPL(__nf_ct_refresh_acct); |
850 | 850 | ||
851 | void __nf_ct_kill_acct(struct nf_conn *ct, | 851 | bool __nf_ct_kill_acct(struct nf_conn *ct, |
852 | enum ip_conntrack_info ctinfo, | 852 | enum ip_conntrack_info ctinfo, |
853 | const struct sk_buff *skb, | 853 | const struct sk_buff *skb, |
854 | int do_acct) | 854 | int do_acct) |
855 | { | 855 | { |
856 | #ifdef CONFIG_NF_CT_ACCT | 856 | #ifdef CONFIG_NF_CT_ACCT |
857 | if (do_acct) { | 857 | if (do_acct) { |
@@ -862,8 +862,11 @@ void __nf_ct_kill_acct(struct nf_conn *ct, | |||
862 | spin_unlock_bh(&nf_conntrack_lock); | 862 | spin_unlock_bh(&nf_conntrack_lock); |
863 | } | 863 | } |
864 | #endif | 864 | #endif |
865 | if (del_timer(&ct->timeout)) | 865 | if (del_timer(&ct->timeout)) { |
866 | ct->timeout.function((unsigned long)ct); | 866 | ct->timeout.function((unsigned long)ct); |
867 | return true; | ||
868 | } | ||
869 | return false; | ||
867 | } | 870 | } |
868 | EXPORT_SYMBOL_GPL(__nf_ct_kill_acct); | 871 | EXPORT_SYMBOL_GPL(__nf_ct_kill_acct); |
869 | 872 | ||