diff options
author | David S. Miller <davem@davemloft.net> | 2011-11-29 01:20:55 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-29 01:20:55 -0500 |
commit | c1baa88431fe0fe4fad492dece4177a7735f89cf (patch) | |
tree | 3513c0018bd149625aa999b82c0ed6097a55a267 /include | |
parent | a5e5c37434eb182cf50cec90d9736d9a9a390116 (diff) | |
parent | 70e9942f17a6193e9172a804e6569a8806633d6b (diff) |
Merge branch 'nf' of git://1984.lsi.us.es/net
Diffstat (limited to 'include')
-rw-r--r-- | include/net/netfilter/nf_conntrack_ecache.h | 19 | ||||
-rw-r--r-- | include/net/netns/conntrack.h | 2 |
2 files changed, 12 insertions, 9 deletions
diff --git a/include/net/netfilter/nf_conntrack_ecache.h b/include/net/netfilter/nf_conntrack_ecache.h index 4283508b3e18..a88fb6939387 100644 --- a/include/net/netfilter/nf_conntrack_ecache.h +++ b/include/net/netfilter/nf_conntrack_ecache.h | |||
@@ -67,18 +67,18 @@ struct nf_ct_event_notifier { | |||
67 | int (*fcn)(unsigned int events, struct nf_ct_event *item); | 67 | int (*fcn)(unsigned int events, struct nf_ct_event *item); |
68 | }; | 68 | }; |
69 | 69 | ||
70 | extern struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb; | 70 | extern int nf_conntrack_register_notifier(struct net *net, struct nf_ct_event_notifier *nb); |
71 | extern int nf_conntrack_register_notifier(struct nf_ct_event_notifier *nb); | 71 | extern void nf_conntrack_unregister_notifier(struct net *net, struct nf_ct_event_notifier *nb); |
72 | extern void nf_conntrack_unregister_notifier(struct nf_ct_event_notifier *nb); | ||
73 | 72 | ||
74 | extern void nf_ct_deliver_cached_events(struct nf_conn *ct); | 73 | extern void nf_ct_deliver_cached_events(struct nf_conn *ct); |
75 | 74 | ||
76 | static inline void | 75 | static inline void |
77 | nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct) | 76 | nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct) |
78 | { | 77 | { |
78 | struct net *net = nf_ct_net(ct); | ||
79 | struct nf_conntrack_ecache *e; | 79 | struct nf_conntrack_ecache *e; |
80 | 80 | ||
81 | if (nf_conntrack_event_cb == NULL) | 81 | if (net->ct.nf_conntrack_event_cb == NULL) |
82 | return; | 82 | return; |
83 | 83 | ||
84 | e = nf_ct_ecache_find(ct); | 84 | e = nf_ct_ecache_find(ct); |
@@ -95,11 +95,12 @@ nf_conntrack_eventmask_report(unsigned int eventmask, | |||
95 | int report) | 95 | int report) |
96 | { | 96 | { |
97 | int ret = 0; | 97 | int ret = 0; |
98 | struct net *net = nf_ct_net(ct); | ||
98 | struct nf_ct_event_notifier *notify; | 99 | struct nf_ct_event_notifier *notify; |
99 | struct nf_conntrack_ecache *e; | 100 | struct nf_conntrack_ecache *e; |
100 | 101 | ||
101 | rcu_read_lock(); | 102 | rcu_read_lock(); |
102 | notify = rcu_dereference(nf_conntrack_event_cb); | 103 | notify = rcu_dereference(net->ct.nf_conntrack_event_cb); |
103 | if (notify == NULL) | 104 | if (notify == NULL) |
104 | goto out_unlock; | 105 | goto out_unlock; |
105 | 106 | ||
@@ -164,9 +165,8 @@ struct nf_exp_event_notifier { | |||
164 | int (*fcn)(unsigned int events, struct nf_exp_event *item); | 165 | int (*fcn)(unsigned int events, struct nf_exp_event *item); |
165 | }; | 166 | }; |
166 | 167 | ||
167 | extern struct nf_exp_event_notifier __rcu *nf_expect_event_cb; | 168 | extern int nf_ct_expect_register_notifier(struct net *net, struct nf_exp_event_notifier *nb); |
168 | extern int nf_ct_expect_register_notifier(struct nf_exp_event_notifier *nb); | 169 | extern void nf_ct_expect_unregister_notifier(struct net *net, struct nf_exp_event_notifier *nb); |
169 | extern void nf_ct_expect_unregister_notifier(struct nf_exp_event_notifier *nb); | ||
170 | 170 | ||
171 | static inline void | 171 | static inline void |
172 | nf_ct_expect_event_report(enum ip_conntrack_expect_events event, | 172 | nf_ct_expect_event_report(enum ip_conntrack_expect_events event, |
@@ -174,11 +174,12 @@ nf_ct_expect_event_report(enum ip_conntrack_expect_events event, | |||
174 | u32 pid, | 174 | u32 pid, |
175 | int report) | 175 | int report) |
176 | { | 176 | { |
177 | struct net *net = nf_ct_exp_net(exp); | ||
177 | struct nf_exp_event_notifier *notify; | 178 | struct nf_exp_event_notifier *notify; |
178 | struct nf_conntrack_ecache *e; | 179 | struct nf_conntrack_ecache *e; |
179 | 180 | ||
180 | rcu_read_lock(); | 181 | rcu_read_lock(); |
181 | notify = rcu_dereference(nf_expect_event_cb); | 182 | notify = rcu_dereference(net->ct.nf_expect_event_cb); |
182 | if (notify == NULL) | 183 | if (notify == NULL) |
183 | goto out_unlock; | 184 | goto out_unlock; |
184 | 185 | ||
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h index 0249399e51a7..7a911eca0f18 100644 --- a/include/net/netns/conntrack.h +++ b/include/net/netns/conntrack.h | |||
@@ -18,6 +18,8 @@ struct netns_ct { | |||
18 | struct hlist_nulls_head unconfirmed; | 18 | struct hlist_nulls_head unconfirmed; |
19 | struct hlist_nulls_head dying; | 19 | struct hlist_nulls_head dying; |
20 | struct ip_conntrack_stat __percpu *stat; | 20 | struct ip_conntrack_stat __percpu *stat; |
21 | struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb; | ||
22 | struct nf_exp_event_notifier __rcu *nf_expect_event_cb; | ||
21 | int sysctl_events; | 23 | int sysctl_events; |
22 | unsigned int sysctl_events_retry_timeout; | 24 | unsigned int sysctl_events_retry_timeout; |
23 | int sysctl_acct; | 25 | int sysctl_acct; |