|
@@ -8,6 +8,7 @@
|
|
|
|
|
|
#include <linux/notifier.h>
|
|
#include <linux/notifier.h>
|
|
#include <linux/interrupt.h>
|
|
#include <linux/interrupt.h>
|
|
|
|
+#include <net/net_namespace.h>
|
|
#include <net/netfilter/nf_conntrack_expect.h>
|
|
#include <net/netfilter/nf_conntrack_expect.h>
|
|
|
|
|
|
#ifdef CONFIG_NF_CONNTRACK_EVENTS
|
|
#ifdef CONFIG_NF_CONNTRACK_EVENTS
|
|
@@ -15,9 +16,6 @@ struct nf_conntrack_ecache {
|
|
struct nf_conn *ct;
|
|
struct nf_conn *ct;
|
|
unsigned int events;
|
|
unsigned int events;
|
|
};
|
|
};
|
|
-DECLARE_PER_CPU(struct nf_conntrack_ecache, nf_conntrack_ecache);
|
|
|
|
-
|
|
|
|
-#define CONNTRACK_ECACHE(x) (__get_cpu_var(nf_conntrack_ecache).x)
|
|
|
|
|
|
|
|
extern struct atomic_notifier_head nf_conntrack_chain;
|
|
extern struct atomic_notifier_head nf_conntrack_chain;
|
|
extern int nf_conntrack_register_notifier(struct notifier_block *nb);
|
|
extern int nf_conntrack_register_notifier(struct notifier_block *nb);
|
|
@@ -25,15 +23,16 @@ extern int nf_conntrack_unregister_notifier(struct notifier_block *nb);
|
|
|
|
|
|
extern void nf_ct_deliver_cached_events(const struct nf_conn *ct);
|
|
extern void nf_ct_deliver_cached_events(const struct nf_conn *ct);
|
|
extern void __nf_ct_event_cache_init(struct nf_conn *ct);
|
|
extern void __nf_ct_event_cache_init(struct nf_conn *ct);
|
|
-extern void nf_ct_event_cache_flush(void);
|
|
|
|
|
|
+extern void nf_ct_event_cache_flush(struct net *net);
|
|
|
|
|
|
static inline void
|
|
static inline void
|
|
nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct)
|
|
nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct)
|
|
{
|
|
{
|
|
|
|
+ struct net *net = nf_ct_net(ct);
|
|
struct nf_conntrack_ecache *ecache;
|
|
struct nf_conntrack_ecache *ecache;
|
|
|
|
|
|
local_bh_disable();
|
|
local_bh_disable();
|
|
- ecache = &__get_cpu_var(nf_conntrack_ecache);
|
|
|
|
|
|
+ ecache = per_cpu_ptr(net->ct.ecache, raw_smp_processor_id());
|
|
if (ct != ecache->ct)
|
|
if (ct != ecache->ct)
|
|
__nf_ct_event_cache_init(ct);
|
|
__nf_ct_event_cache_init(ct);
|
|
ecache->events |= event;
|
|
ecache->events |= event;
|
|
@@ -58,6 +57,9 @@ nf_ct_expect_event(enum ip_conntrack_expect_events event,
|
|
atomic_notifier_call_chain(&nf_ct_expect_chain, event, exp);
|
|
atomic_notifier_call_chain(&nf_ct_expect_chain, event, exp);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+extern int nf_conntrack_ecache_init(struct net *net);
|
|
|
|
+extern void nf_conntrack_ecache_fini(struct net *net);
|
|
|
|
+
|
|
#else /* CONFIG_NF_CONNTRACK_EVENTS */
|
|
#else /* CONFIG_NF_CONNTRACK_EVENTS */
|
|
|
|
|
|
static inline void nf_conntrack_event_cache(enum ip_conntrack_events event,
|
|
static inline void nf_conntrack_event_cache(enum ip_conntrack_events event,
|
|
@@ -67,7 +69,15 @@ static inline void nf_conntrack_event(enum ip_conntrack_events event,
|
|
static inline void nf_ct_deliver_cached_events(const struct nf_conn *ct) {}
|
|
static inline void nf_ct_deliver_cached_events(const struct nf_conn *ct) {}
|
|
static inline void nf_ct_expect_event(enum ip_conntrack_expect_events event,
|
|
static inline void nf_ct_expect_event(enum ip_conntrack_expect_events event,
|
|
struct nf_conntrack_expect *exp) {}
|
|
struct nf_conntrack_expect *exp) {}
|
|
-static inline void nf_ct_event_cache_flush(void) {}
|
|
|
|
|
|
+static inline void nf_ct_event_cache_flush(struct net *net) {}
|
|
|
|
+
|
|
|
|
+static inline int nf_conntrack_ecache_init(struct net *net)
|
|
|
|
+{
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
|
|
+static inline void nf_conntrack_ecache_fini(struct net *net)
|
|
|
|
+{
|
|
|
|
+}
|
|
#endif /* CONFIG_NF_CONNTRACK_EVENTS */
|
|
#endif /* CONFIG_NF_CONNTRACK_EVENTS */
|
|
|
|
|
|
#endif /*_NF_CONNTRACK_ECACHE_H*/
|
|
#endif /*_NF_CONNTRACK_ECACHE_H*/
|