diff options
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/nf_conntrack_amanda.c | 11 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_core.c | 12 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_ecache.c | 16 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_expect.c | 93 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_ftp.c | 6 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_h323_main.c | 127 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_helper.c | 4 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_irc.c | 12 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_netbios_ns.c | 6 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_netlink.c | 40 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_pptp.c | 44 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_sane.c | 12 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_sip.c | 12 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_tftp.c | 12 |
14 files changed, 200 insertions, 207 deletions
diff --git a/net/netfilter/nf_conntrack_amanda.c b/net/netfilter/nf_conntrack_amanda.c index 0568f2e86b59..d21359e6c14c 100644 --- a/net/netfilter/nf_conntrack_amanda.c +++ b/net/netfilter/nf_conntrack_amanda.c | |||
@@ -142,23 +142,22 @@ static int amanda_help(struct sk_buff **pskb, | |||
142 | if (port == 0 || len > 5) | 142 | if (port == 0 || len > 5) |
143 | break; | 143 | break; |
144 | 144 | ||
145 | exp = nf_conntrack_expect_alloc(ct); | 145 | exp = nf_ct_expect_alloc(ct); |
146 | if (exp == NULL) { | 146 | if (exp == NULL) { |
147 | ret = NF_DROP; | 147 | ret = NF_DROP; |
148 | goto out; | 148 | goto out; |
149 | } | 149 | } |
150 | tuple = &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple; | 150 | tuple = &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple; |
151 | nf_conntrack_expect_init(exp, family, | 151 | nf_ct_expect_init(exp, family, &tuple->src.u3, &tuple->dst.u3, |
152 | &tuple->src.u3, &tuple->dst.u3, | 152 | IPPROTO_TCP, NULL, &port); |
153 | IPPROTO_TCP, NULL, &port); | ||
154 | 153 | ||
155 | nf_nat_amanda = rcu_dereference(nf_nat_amanda_hook); | 154 | nf_nat_amanda = rcu_dereference(nf_nat_amanda_hook); |
156 | if (nf_nat_amanda && ct->status & IPS_NAT_MASK) | 155 | if (nf_nat_amanda && ct->status & IPS_NAT_MASK) |
157 | ret = nf_nat_amanda(pskb, ctinfo, off - dataoff, | 156 | ret = nf_nat_amanda(pskb, ctinfo, off - dataoff, |
158 | len, exp); | 157 | len, exp); |
159 | else if (nf_conntrack_expect_related(exp) != 0) | 158 | else if (nf_ct_expect_related(exp) != 0) |
160 | ret = NF_DROP; | 159 | ret = NF_DROP; |
161 | nf_conntrack_expect_put(exp); | 160 | nf_ct_expect_put(exp); |
162 | } | 161 | } |
163 | 162 | ||
164 | out: | 163 | out: |
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index f4c3039728dc..793f12ff168b 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c | |||
@@ -494,7 +494,7 @@ init_conntrack(const struct nf_conntrack_tuple *tuple, | |||
494 | } | 494 | } |
495 | 495 | ||
496 | write_lock_bh(&nf_conntrack_lock); | 496 | write_lock_bh(&nf_conntrack_lock); |
497 | exp = find_expectation(tuple); | 497 | exp = nf_ct_find_expectation(tuple); |
498 | if (exp) { | 498 | if (exp) { |
499 | DEBUGP("conntrack: expectation arrives ct=%p exp=%p\n", | 499 | DEBUGP("conntrack: expectation arrives ct=%p exp=%p\n", |
500 | conntrack, exp); | 500 | conntrack, exp); |
@@ -544,7 +544,7 @@ init_conntrack(const struct nf_conntrack_tuple *tuple, | |||
544 | if (exp) { | 544 | if (exp) { |
545 | if (exp->expectfn) | 545 | if (exp->expectfn) |
546 | exp->expectfn(conntrack, exp); | 546 | exp->expectfn(conntrack, exp); |
547 | nf_conntrack_expect_put(exp); | 547 | nf_ct_expect_put(exp); |
548 | } | 548 | } |
549 | 549 | ||
550 | return &conntrack->tuplehash[IP_CT_DIR_ORIGINAL]; | 550 | return &conntrack->tuplehash[IP_CT_DIR_ORIGINAL]; |
@@ -961,7 +961,7 @@ void nf_conntrack_cleanup(void) | |||
961 | rcu_assign_pointer(nf_ct_destroy, NULL); | 961 | rcu_assign_pointer(nf_ct_destroy, NULL); |
962 | 962 | ||
963 | kmem_cache_destroy(nf_conntrack_cachep); | 963 | kmem_cache_destroy(nf_conntrack_cachep); |
964 | kmem_cache_destroy(nf_conntrack_expect_cachep); | 964 | kmem_cache_destroy(nf_ct_expect_cachep); |
965 | nf_ct_free_hashtable(nf_conntrack_hash, nf_conntrack_vmalloc, | 965 | nf_ct_free_hashtable(nf_conntrack_hash, nf_conntrack_vmalloc, |
966 | nf_conntrack_htable_size); | 966 | nf_conntrack_htable_size); |
967 | 967 | ||
@@ -1088,10 +1088,10 @@ int __init nf_conntrack_init(void) | |||
1088 | goto err_free_hash; | 1088 | goto err_free_hash; |
1089 | } | 1089 | } |
1090 | 1090 | ||
1091 | nf_conntrack_expect_cachep = kmem_cache_create("nf_conntrack_expect", | 1091 | nf_ct_expect_cachep = kmem_cache_create("nf_conntrack_expect", |
1092 | sizeof(struct nf_conntrack_expect), | 1092 | sizeof(struct nf_conntrack_expect), |
1093 | 0, 0, NULL, NULL); | 1093 | 0, 0, NULL, NULL); |
1094 | if (!nf_conntrack_expect_cachep) { | 1094 | if (!nf_ct_expect_cachep) { |
1095 | printk(KERN_ERR "Unable to create nf_expect slab cache\n"); | 1095 | printk(KERN_ERR "Unable to create nf_expect slab cache\n"); |
1096 | goto err_free_conntrack_slab; | 1096 | goto err_free_conntrack_slab; |
1097 | } | 1097 | } |
@@ -1119,7 +1119,7 @@ int __init nf_conntrack_init(void) | |||
1119 | out_fini_proto: | 1119 | out_fini_proto: |
1120 | nf_conntrack_proto_fini(); | 1120 | nf_conntrack_proto_fini(); |
1121 | out_free_expect_slab: | 1121 | out_free_expect_slab: |
1122 | kmem_cache_destroy(nf_conntrack_expect_cachep); | 1122 | kmem_cache_destroy(nf_ct_expect_cachep); |
1123 | err_free_conntrack_slab: | 1123 | err_free_conntrack_slab: |
1124 | kmem_cache_destroy(nf_conntrack_cachep); | 1124 | kmem_cache_destroy(nf_conntrack_cachep); |
1125 | err_free_hash: | 1125 | err_free_hash: |
diff --git a/net/netfilter/nf_conntrack_ecache.c b/net/netfilter/nf_conntrack_ecache.c index 6bd421df2dbc..83c41ac3505b 100644 --- a/net/netfilter/nf_conntrack_ecache.c +++ b/net/netfilter/nf_conntrack_ecache.c | |||
@@ -26,8 +26,8 @@ | |||
26 | ATOMIC_NOTIFIER_HEAD(nf_conntrack_chain); | 26 | ATOMIC_NOTIFIER_HEAD(nf_conntrack_chain); |
27 | EXPORT_SYMBOL_GPL(nf_conntrack_chain); | 27 | EXPORT_SYMBOL_GPL(nf_conntrack_chain); |
28 | 28 | ||
29 | ATOMIC_NOTIFIER_HEAD(nf_conntrack_expect_chain); | 29 | ATOMIC_NOTIFIER_HEAD(nf_ct_expect_chain); |
30 | EXPORT_SYMBOL_GPL(nf_conntrack_expect_chain); | 30 | EXPORT_SYMBOL_GPL(nf_ct_expect_chain); |
31 | 31 | ||
32 | DEFINE_PER_CPU(struct nf_conntrack_ecache, nf_conntrack_ecache); | 32 | DEFINE_PER_CPU(struct nf_conntrack_ecache, nf_conntrack_ecache); |
33 | EXPORT_PER_CPU_SYMBOL_GPL(nf_conntrack_ecache); | 33 | EXPORT_PER_CPU_SYMBOL_GPL(nf_conntrack_ecache); |
@@ -103,14 +103,14 @@ int nf_conntrack_unregister_notifier(struct notifier_block *nb) | |||
103 | } | 103 | } |
104 | EXPORT_SYMBOL_GPL(nf_conntrack_unregister_notifier); | 104 | EXPORT_SYMBOL_GPL(nf_conntrack_unregister_notifier); |
105 | 105 | ||
106 | int nf_conntrack_expect_register_notifier(struct notifier_block *nb) | 106 | int nf_ct_expect_register_notifier(struct notifier_block *nb) |
107 | { | 107 | { |
108 | return atomic_notifier_chain_register(&nf_conntrack_expect_chain, nb); | 108 | return atomic_notifier_chain_register(&nf_ct_expect_chain, nb); |
109 | } | 109 | } |
110 | EXPORT_SYMBOL_GPL(nf_conntrack_expect_register_notifier); | 110 | EXPORT_SYMBOL_GPL(nf_ct_expect_register_notifier); |
111 | 111 | ||
112 | int nf_conntrack_expect_unregister_notifier(struct notifier_block *nb) | 112 | int nf_ct_expect_unregister_notifier(struct notifier_block *nb) |
113 | { | 113 | { |
114 | return atomic_notifier_chain_unregister(&nf_conntrack_expect_chain, nb); | 114 | return atomic_notifier_chain_unregister(&nf_ct_expect_chain, nb); |
115 | } | 115 | } |
116 | EXPORT_SYMBOL_GPL(nf_conntrack_expect_unregister_notifier); | 116 | EXPORT_SYMBOL_GPL(nf_ct_expect_unregister_notifier); |
diff --git a/net/netfilter/nf_conntrack_expect.c b/net/netfilter/nf_conntrack_expect.c index 504fb6c083f9..4130ea662c48 100644 --- a/net/netfilter/nf_conntrack_expect.c +++ b/net/netfilter/nf_conntrack_expect.c | |||
@@ -26,11 +26,11 @@ | |||
26 | #include <net/netfilter/nf_conntrack_helper.h> | 26 | #include <net/netfilter/nf_conntrack_helper.h> |
27 | #include <net/netfilter/nf_conntrack_tuple.h> | 27 | #include <net/netfilter/nf_conntrack_tuple.h> |
28 | 28 | ||
29 | LIST_HEAD(nf_conntrack_expect_list); | 29 | LIST_HEAD(nf_ct_expect_list); |
30 | EXPORT_SYMBOL_GPL(nf_conntrack_expect_list); | 30 | EXPORT_SYMBOL_GPL(nf_ct_expect_list); |
31 | 31 | ||
32 | struct kmem_cache *nf_conntrack_expect_cachep __read_mostly; | 32 | struct kmem_cache *nf_ct_expect_cachep __read_mostly; |
33 | static unsigned int nf_conntrack_expect_next_id; | 33 | static unsigned int nf_ct_expect_next_id; |
34 | 34 | ||
35 | /* nf_conntrack_expect helper functions */ | 35 | /* nf_conntrack_expect helper functions */ |
36 | void nf_ct_unlink_expect(struct nf_conntrack_expect *exp) | 36 | void nf_ct_unlink_expect(struct nf_conntrack_expect *exp) |
@@ -43,57 +43,57 @@ void nf_ct_unlink_expect(struct nf_conntrack_expect *exp) | |||
43 | list_del(&exp->list); | 43 | list_del(&exp->list); |
44 | NF_CT_STAT_INC(expect_delete); | 44 | NF_CT_STAT_INC(expect_delete); |
45 | master_help->expecting--; | 45 | master_help->expecting--; |
46 | nf_conntrack_expect_put(exp); | 46 | nf_ct_expect_put(exp); |
47 | } | 47 | } |
48 | EXPORT_SYMBOL_GPL(nf_ct_unlink_expect); | 48 | EXPORT_SYMBOL_GPL(nf_ct_unlink_expect); |
49 | 49 | ||
50 | static void expectation_timed_out(unsigned long ul_expect) | 50 | static void nf_ct_expectation_timed_out(unsigned long ul_expect) |
51 | { | 51 | { |
52 | struct nf_conntrack_expect *exp = (void *)ul_expect; | 52 | struct nf_conntrack_expect *exp = (void *)ul_expect; |
53 | 53 | ||
54 | write_lock_bh(&nf_conntrack_lock); | 54 | write_lock_bh(&nf_conntrack_lock); |
55 | nf_ct_unlink_expect(exp); | 55 | nf_ct_unlink_expect(exp); |
56 | write_unlock_bh(&nf_conntrack_lock); | 56 | write_unlock_bh(&nf_conntrack_lock); |
57 | nf_conntrack_expect_put(exp); | 57 | nf_ct_expect_put(exp); |
58 | } | 58 | } |
59 | 59 | ||
60 | struct nf_conntrack_expect * | 60 | struct nf_conntrack_expect * |
61 | __nf_conntrack_expect_find(const struct nf_conntrack_tuple *tuple) | 61 | __nf_ct_expect_find(const struct nf_conntrack_tuple *tuple) |
62 | { | 62 | { |
63 | struct nf_conntrack_expect *i; | 63 | struct nf_conntrack_expect *i; |
64 | 64 | ||
65 | list_for_each_entry(i, &nf_conntrack_expect_list, list) { | 65 | list_for_each_entry(i, &nf_ct_expect_list, list) { |
66 | if (nf_ct_tuple_mask_cmp(tuple, &i->tuple, &i->mask)) | 66 | if (nf_ct_tuple_mask_cmp(tuple, &i->tuple, &i->mask)) |
67 | return i; | 67 | return i; |
68 | } | 68 | } |
69 | return NULL; | 69 | return NULL; |
70 | } | 70 | } |
71 | EXPORT_SYMBOL_GPL(__nf_conntrack_expect_find); | 71 | EXPORT_SYMBOL_GPL(__nf_ct_expect_find); |
72 | 72 | ||
73 | /* Just find a expectation corresponding to a tuple. */ | 73 | /* Just find a expectation corresponding to a tuple. */ |
74 | struct nf_conntrack_expect * | 74 | struct nf_conntrack_expect * |
75 | nf_conntrack_expect_find_get(const struct nf_conntrack_tuple *tuple) | 75 | nf_ct_expect_find_get(const struct nf_conntrack_tuple *tuple) |
76 | { | 76 | { |
77 | struct nf_conntrack_expect *i; | 77 | struct nf_conntrack_expect *i; |
78 | 78 | ||
79 | read_lock_bh(&nf_conntrack_lock); | 79 | read_lock_bh(&nf_conntrack_lock); |
80 | i = __nf_conntrack_expect_find(tuple); | 80 | i = __nf_ct_expect_find(tuple); |
81 | if (i) | 81 | if (i) |
82 | atomic_inc(&i->use); | 82 | atomic_inc(&i->use); |
83 | read_unlock_bh(&nf_conntrack_lock); | 83 | read_unlock_bh(&nf_conntrack_lock); |
84 | 84 | ||
85 | return i; | 85 | return i; |
86 | } | 86 | } |
87 | EXPORT_SYMBOL_GPL(nf_conntrack_expect_find_get); | 87 | EXPORT_SYMBOL_GPL(nf_ct_expect_find_get); |
88 | 88 | ||
89 | /* If an expectation for this connection is found, it gets delete from | 89 | /* If an expectation for this connection is found, it gets delete from |
90 | * global list then returned. */ | 90 | * global list then returned. */ |
91 | struct nf_conntrack_expect * | 91 | struct nf_conntrack_expect * |
92 | find_expectation(const struct nf_conntrack_tuple *tuple) | 92 | nf_ct_find_expectation(const struct nf_conntrack_tuple *tuple) |
93 | { | 93 | { |
94 | struct nf_conntrack_expect *exp; | 94 | struct nf_conntrack_expect *exp; |
95 | 95 | ||
96 | exp = __nf_conntrack_expect_find(tuple); | 96 | exp = __nf_ct_expect_find(tuple); |
97 | if (!exp) | 97 | if (!exp) |
98 | return NULL; | 98 | return NULL; |
99 | 99 | ||
@@ -126,10 +126,10 @@ void nf_ct_remove_expectations(struct nf_conn *ct) | |||
126 | if (!help || help->expecting == 0) | 126 | if (!help || help->expecting == 0) |
127 | return; | 127 | return; |
128 | 128 | ||
129 | list_for_each_entry_safe(i, tmp, &nf_conntrack_expect_list, list) { | 129 | list_for_each_entry_safe(i, tmp, &nf_ct_expect_list, list) { |
130 | if (i->master == ct && del_timer(&i->timeout)) { | 130 | if (i->master == ct && del_timer(&i->timeout)) { |
131 | nf_ct_unlink_expect(i); | 131 | nf_ct_unlink_expect(i); |
132 | nf_conntrack_expect_put(i); | 132 | nf_ct_expect_put(i); |
133 | } | 133 | } |
134 | } | 134 | } |
135 | } | 135 | } |
@@ -172,32 +172,32 @@ static inline int expect_matches(const struct nf_conntrack_expect *a, | |||
172 | } | 172 | } |
173 | 173 | ||
174 | /* Generally a bad idea to call this: could have matched already. */ | 174 | /* Generally a bad idea to call this: could have matched already. */ |
175 | void nf_conntrack_unexpect_related(struct nf_conntrack_expect *exp) | 175 | void nf_ct_unexpect_related(struct nf_conntrack_expect *exp) |
176 | { | 176 | { |
177 | struct nf_conntrack_expect *i; | 177 | struct nf_conntrack_expect *i; |
178 | 178 | ||
179 | write_lock_bh(&nf_conntrack_lock); | 179 | write_lock_bh(&nf_conntrack_lock); |
180 | /* choose the oldest expectation to evict */ | 180 | /* choose the oldest expectation to evict */ |
181 | list_for_each_entry_reverse(i, &nf_conntrack_expect_list, list) { | 181 | list_for_each_entry_reverse(i, &nf_ct_expect_list, list) { |
182 | if (expect_matches(i, exp) && del_timer(&i->timeout)) { | 182 | if (expect_matches(i, exp) && del_timer(&i->timeout)) { |
183 | nf_ct_unlink_expect(i); | 183 | nf_ct_unlink_expect(i); |
184 | write_unlock_bh(&nf_conntrack_lock); | 184 | write_unlock_bh(&nf_conntrack_lock); |
185 | nf_conntrack_expect_put(i); | 185 | nf_ct_expect_put(i); |
186 | return; | 186 | return; |
187 | } | 187 | } |
188 | } | 188 | } |
189 | write_unlock_bh(&nf_conntrack_lock); | 189 | write_unlock_bh(&nf_conntrack_lock); |
190 | } | 190 | } |
191 | EXPORT_SYMBOL_GPL(nf_conntrack_unexpect_related); | 191 | EXPORT_SYMBOL_GPL(nf_ct_unexpect_related); |
192 | 192 | ||
193 | /* We don't increase the master conntrack refcount for non-fulfilled | 193 | /* We don't increase the master conntrack refcount for non-fulfilled |
194 | * conntracks. During the conntrack destruction, the expectations are | 194 | * conntracks. During the conntrack destruction, the expectations are |
195 | * always killed before the conntrack itself */ | 195 | * always killed before the conntrack itself */ |
196 | struct nf_conntrack_expect *nf_conntrack_expect_alloc(struct nf_conn *me) | 196 | struct nf_conntrack_expect *nf_ct_expect_alloc(struct nf_conn *me) |
197 | { | 197 | { |
198 | struct nf_conntrack_expect *new; | 198 | struct nf_conntrack_expect *new; |
199 | 199 | ||
200 | new = kmem_cache_alloc(nf_conntrack_expect_cachep, GFP_ATOMIC); | 200 | new = kmem_cache_alloc(nf_ct_expect_cachep, GFP_ATOMIC); |
201 | if (!new) | 201 | if (!new) |
202 | return NULL; | 202 | return NULL; |
203 | 203 | ||
@@ -205,12 +205,12 @@ struct nf_conntrack_expect *nf_conntrack_expect_alloc(struct nf_conn *me) | |||
205 | atomic_set(&new->use, 1); | 205 | atomic_set(&new->use, 1); |
206 | return new; | 206 | return new; |
207 | } | 207 | } |
208 | EXPORT_SYMBOL_GPL(nf_conntrack_expect_alloc); | 208 | EXPORT_SYMBOL_GPL(nf_ct_expect_alloc); |
209 | 209 | ||
210 | void nf_conntrack_expect_init(struct nf_conntrack_expect *exp, int family, | 210 | void nf_ct_expect_init(struct nf_conntrack_expect *exp, int family, |
211 | union nf_conntrack_address *saddr, | 211 | union nf_conntrack_address *saddr, |
212 | union nf_conntrack_address *daddr, | 212 | union nf_conntrack_address *daddr, |
213 | u_int8_t proto, __be16 *src, __be16 *dst) | 213 | u_int8_t proto, __be16 *src, __be16 *dst) |
214 | { | 214 | { |
215 | int len; | 215 | int len; |
216 | 216 | ||
@@ -273,28 +273,29 @@ void nf_conntrack_expect_init(struct nf_conntrack_expect *exp, int family, | |||
273 | exp->mask.dst.u.all = 0; | 273 | exp->mask.dst.u.all = 0; |
274 | } | 274 | } |
275 | } | 275 | } |
276 | EXPORT_SYMBOL_GPL(nf_conntrack_expect_init); | 276 | EXPORT_SYMBOL_GPL(nf_ct_expect_init); |
277 | 277 | ||
278 | void nf_conntrack_expect_put(struct nf_conntrack_expect *exp) | 278 | void nf_ct_expect_put(struct nf_conntrack_expect *exp) |
279 | { | 279 | { |
280 | if (atomic_dec_and_test(&exp->use)) | 280 | if (atomic_dec_and_test(&exp->use)) |
281 | kmem_cache_free(nf_conntrack_expect_cachep, exp); | 281 | kmem_cache_free(nf_ct_expect_cachep, exp); |
282 | } | 282 | } |
283 | EXPORT_SYMBOL_GPL(nf_conntrack_expect_put); | 283 | EXPORT_SYMBOL_GPL(nf_ct_expect_put); |
284 | 284 | ||
285 | static void nf_conntrack_expect_insert(struct nf_conntrack_expect *exp) | 285 | static void nf_ct_expect_insert(struct nf_conntrack_expect *exp) |
286 | { | 286 | { |
287 | struct nf_conn_help *master_help = nfct_help(exp->master); | 287 | struct nf_conn_help *master_help = nfct_help(exp->master); |
288 | 288 | ||
289 | atomic_inc(&exp->use); | 289 | atomic_inc(&exp->use); |
290 | master_help->expecting++; | 290 | master_help->expecting++; |
291 | list_add(&exp->list, &nf_conntrack_expect_list); | 291 | list_add(&exp->list, &nf_ct_expect_list); |
292 | 292 | ||
293 | setup_timer(&exp->timeout, expectation_timed_out, (unsigned long)exp); | 293 | setup_timer(&exp->timeout, nf_ct_expectation_timed_out, |
294 | (unsigned long)exp); | ||
294 | exp->timeout.expires = jiffies + master_help->helper->timeout * HZ; | 295 | exp->timeout.expires = jiffies + master_help->helper->timeout * HZ; |
295 | add_timer(&exp->timeout); | 296 | add_timer(&exp->timeout); |
296 | 297 | ||
297 | exp->id = ++nf_conntrack_expect_next_id; | 298 | exp->id = ++nf_ct_expect_next_id; |
298 | atomic_inc(&exp->use); | 299 | atomic_inc(&exp->use); |
299 | NF_CT_STAT_INC(expect_create); | 300 | NF_CT_STAT_INC(expect_create); |
300 | } | 301 | } |
@@ -304,11 +305,11 @@ static void evict_oldest_expect(struct nf_conn *master) | |||
304 | { | 305 | { |
305 | struct nf_conntrack_expect *i; | 306 | struct nf_conntrack_expect *i; |
306 | 307 | ||
307 | list_for_each_entry_reverse(i, &nf_conntrack_expect_list, list) { | 308 | list_for_each_entry_reverse(i, &nf_ct_expect_list, list) { |
308 | if (i->master == master) { | 309 | if (i->master == master) { |
309 | if (del_timer(&i->timeout)) { | 310 | if (del_timer(&i->timeout)) { |
310 | nf_ct_unlink_expect(i); | 311 | nf_ct_unlink_expect(i); |
311 | nf_conntrack_expect_put(i); | 312 | nf_ct_expect_put(i); |
312 | } | 313 | } |
313 | break; | 314 | break; |
314 | } | 315 | } |
@@ -327,7 +328,7 @@ static inline int refresh_timer(struct nf_conntrack_expect *i) | |||
327 | return 1; | 328 | return 1; |
328 | } | 329 | } |
329 | 330 | ||
330 | int nf_conntrack_expect_related(struct nf_conntrack_expect *expect) | 331 | int nf_ct_expect_related(struct nf_conntrack_expect *expect) |
331 | { | 332 | { |
332 | struct nf_conntrack_expect *i; | 333 | struct nf_conntrack_expect *i; |
333 | struct nf_conn *master = expect->master; | 334 | struct nf_conn *master = expect->master; |
@@ -341,7 +342,7 @@ int nf_conntrack_expect_related(struct nf_conntrack_expect *expect) | |||
341 | ret = -ESHUTDOWN; | 342 | ret = -ESHUTDOWN; |
342 | goto out; | 343 | goto out; |
343 | } | 344 | } |
344 | list_for_each_entry(i, &nf_conntrack_expect_list, list) { | 345 | list_for_each_entry(i, &nf_ct_expect_list, list) { |
345 | if (expect_matches(i, expect)) { | 346 | if (expect_matches(i, expect)) { |
346 | /* Refresh timer: if it's dying, ignore.. */ | 347 | /* Refresh timer: if it's dying, ignore.. */ |
347 | if (refresh_timer(i)) { | 348 | if (refresh_timer(i)) { |
@@ -358,19 +359,19 @@ int nf_conntrack_expect_related(struct nf_conntrack_expect *expect) | |||
358 | master_help->expecting >= master_help->helper->max_expected) | 359 | master_help->expecting >= master_help->helper->max_expected) |
359 | evict_oldest_expect(master); | 360 | evict_oldest_expect(master); |
360 | 361 | ||
361 | nf_conntrack_expect_insert(expect); | 362 | nf_ct_expect_insert(expect); |
362 | nf_conntrack_expect_event(IPEXP_NEW, expect); | 363 | nf_ct_expect_event(IPEXP_NEW, expect); |
363 | ret = 0; | 364 | ret = 0; |
364 | out: | 365 | out: |
365 | write_unlock_bh(&nf_conntrack_lock); | 366 | write_unlock_bh(&nf_conntrack_lock); |
366 | return ret; | 367 | return ret; |
367 | } | 368 | } |
368 | EXPORT_SYMBOL_GPL(nf_conntrack_expect_related); | 369 | EXPORT_SYMBOL_GPL(nf_ct_expect_related); |
369 | 370 | ||
370 | #ifdef CONFIG_PROC_FS | 371 | #ifdef CONFIG_PROC_FS |
371 | static void *exp_seq_start(struct seq_file *s, loff_t *pos) | 372 | static void *exp_seq_start(struct seq_file *s, loff_t *pos) |
372 | { | 373 | { |
373 | struct list_head *e = &nf_conntrack_expect_list; | 374 | struct list_head *e = &nf_ct_expect_list; |
374 | loff_t i; | 375 | loff_t i; |
375 | 376 | ||
376 | /* strange seq_file api calls stop even if we fail, | 377 | /* strange seq_file api calls stop even if we fail, |
@@ -382,7 +383,7 @@ static void *exp_seq_start(struct seq_file *s, loff_t *pos) | |||
382 | 383 | ||
383 | for (i = 0; i <= *pos; i++) { | 384 | for (i = 0; i <= *pos; i++) { |
384 | e = e->next; | 385 | e = e->next; |
385 | if (e == &nf_conntrack_expect_list) | 386 | if (e == &nf_ct_expect_list) |
386 | return NULL; | 387 | return NULL; |
387 | } | 388 | } |
388 | return e; | 389 | return e; |
@@ -395,7 +396,7 @@ static void *exp_seq_next(struct seq_file *s, void *v, loff_t *pos) | |||
395 | ++*pos; | 396 | ++*pos; |
396 | e = e->next; | 397 | e = e->next; |
397 | 398 | ||
398 | if (e == &nf_conntrack_expect_list) | 399 | if (e == &nf_ct_expect_list) |
399 | return NULL; | 400 | return NULL; |
400 | 401 | ||
401 | return e; | 402 | return e; |
diff --git a/net/netfilter/nf_conntrack_ftp.c b/net/netfilter/nf_conntrack_ftp.c index 82db2aa53bfc..5efe65d4b3c0 100644 --- a/net/netfilter/nf_conntrack_ftp.c +++ b/net/netfilter/nf_conntrack_ftp.c | |||
@@ -445,7 +445,7 @@ static int help(struct sk_buff **pskb, | |||
445 | (int)matchlen, fb_ptr + matchoff, | 445 | (int)matchlen, fb_ptr + matchoff, |
446 | matchlen, ntohl(th->seq) + matchoff); | 446 | matchlen, ntohl(th->seq) + matchoff); |
447 | 447 | ||
448 | exp = nf_conntrack_expect_alloc(ct); | 448 | exp = nf_ct_expect_alloc(ct); |
449 | if (exp == NULL) { | 449 | if (exp == NULL) { |
450 | ret = NF_DROP; | 450 | ret = NF_DROP; |
451 | goto out; | 451 | goto out; |
@@ -523,14 +523,14 @@ static int help(struct sk_buff **pskb, | |||
523 | matchoff, matchlen, exp); | 523 | matchoff, matchlen, exp); |
524 | else { | 524 | else { |
525 | /* Can't expect this? Best to drop packet now. */ | 525 | /* Can't expect this? Best to drop packet now. */ |
526 | if (nf_conntrack_expect_related(exp) != 0) | 526 | if (nf_ct_expect_related(exp) != 0) |
527 | ret = NF_DROP; | 527 | ret = NF_DROP; |
528 | else | 528 | else |
529 | ret = NF_ACCEPT; | 529 | ret = NF_ACCEPT; |
530 | } | 530 | } |
531 | 531 | ||
532 | out_put_expect: | 532 | out_put_expect: |
533 | nf_conntrack_expect_put(exp); | 533 | nf_ct_expect_put(exp); |
534 | 534 | ||
535 | out_update_nl: | 535 | out_update_nl: |
536 | /* Now if this ends in \n, update ftp info. Seq may have been | 536 | /* Now if this ends in \n, update ftp info. Seq may have been |
diff --git a/net/netfilter/nf_conntrack_h323_main.c b/net/netfilter/nf_conntrack_h323_main.c index a1b95acad297..61ae90fb328a 100644 --- a/net/netfilter/nf_conntrack_h323_main.c +++ b/net/netfilter/nf_conntrack_h323_main.c | |||
@@ -282,22 +282,22 @@ static int expect_rtp_rtcp(struct sk_buff **pskb, struct nf_conn *ct, | |||
282 | rtcp_port = htons(ntohs(port) + 1); | 282 | rtcp_port = htons(ntohs(port) + 1); |
283 | 283 | ||
284 | /* Create expect for RTP */ | 284 | /* Create expect for RTP */ |
285 | if ((rtp_exp = nf_conntrack_expect_alloc(ct)) == NULL) | 285 | if ((rtp_exp = nf_ct_expect_alloc(ct)) == NULL) |
286 | return -1; | 286 | return -1; |
287 | nf_conntrack_expect_init(rtp_exp, ct->tuplehash[!dir].tuple.src.l3num, | 287 | nf_ct_expect_init(rtp_exp, ct->tuplehash[!dir].tuple.src.l3num, |
288 | &ct->tuplehash[!dir].tuple.src.u3, | 288 | &ct->tuplehash[!dir].tuple.src.u3, |
289 | &ct->tuplehash[!dir].tuple.dst.u3, | 289 | &ct->tuplehash[!dir].tuple.dst.u3, |
290 | IPPROTO_UDP, NULL, &rtp_port); | 290 | IPPROTO_UDP, NULL, &rtp_port); |
291 | 291 | ||
292 | /* Create expect for RTCP */ | 292 | /* Create expect for RTCP */ |
293 | if ((rtcp_exp = nf_conntrack_expect_alloc(ct)) == NULL) { | 293 | if ((rtcp_exp = nf_ct_expect_alloc(ct)) == NULL) { |
294 | nf_conntrack_expect_put(rtp_exp); | 294 | nf_ct_expect_put(rtp_exp); |
295 | return -1; | 295 | return -1; |
296 | } | 296 | } |
297 | nf_conntrack_expect_init(rtcp_exp, ct->tuplehash[!dir].tuple.src.l3num, | 297 | nf_ct_expect_init(rtcp_exp, ct->tuplehash[!dir].tuple.src.l3num, |
298 | &ct->tuplehash[!dir].tuple.src.u3, | 298 | &ct->tuplehash[!dir].tuple.src.u3, |
299 | &ct->tuplehash[!dir].tuple.dst.u3, | 299 | &ct->tuplehash[!dir].tuple.dst.u3, |
300 | IPPROTO_UDP, NULL, &rtcp_port); | 300 | IPPROTO_UDP, NULL, &rtcp_port); |
301 | 301 | ||
302 | if (memcmp(&ct->tuplehash[dir].tuple.src.u3, | 302 | if (memcmp(&ct->tuplehash[dir].tuple.src.u3, |
303 | &ct->tuplehash[!dir].tuple.dst.u3, | 303 | &ct->tuplehash[!dir].tuple.dst.u3, |
@@ -308,22 +308,22 @@ static int expect_rtp_rtcp(struct sk_buff **pskb, struct nf_conn *ct, | |||
308 | ret = nat_rtp_rtcp(pskb, ct, ctinfo, data, dataoff, | 308 | ret = nat_rtp_rtcp(pskb, ct, ctinfo, data, dataoff, |
309 | taddr, port, rtp_port, rtp_exp, rtcp_exp); | 309 | taddr, port, rtp_port, rtp_exp, rtcp_exp); |
310 | } else { /* Conntrack only */ | 310 | } else { /* Conntrack only */ |
311 | if (nf_conntrack_expect_related(rtp_exp) == 0) { | 311 | if (nf_ct_expect_related(rtp_exp) == 0) { |
312 | if (nf_conntrack_expect_related(rtcp_exp) == 0) { | 312 | if (nf_ct_expect_related(rtcp_exp) == 0) { |
313 | DEBUGP("nf_ct_h323: expect RTP "); | 313 | DEBUGP("nf_ct_h323: expect RTP "); |
314 | NF_CT_DUMP_TUPLE(&rtp_exp->tuple); | 314 | NF_CT_DUMP_TUPLE(&rtp_exp->tuple); |
315 | DEBUGP("nf_ct_h323: expect RTCP "); | 315 | DEBUGP("nf_ct_h323: expect RTCP "); |
316 | NF_CT_DUMP_TUPLE(&rtcp_exp->tuple); | 316 | NF_CT_DUMP_TUPLE(&rtcp_exp->tuple); |
317 | } else { | 317 | } else { |
318 | nf_conntrack_unexpect_related(rtp_exp); | 318 | nf_ct_unexpect_related(rtp_exp); |
319 | ret = -1; | 319 | ret = -1; |
320 | } | 320 | } |
321 | } else | 321 | } else |
322 | ret = -1; | 322 | ret = -1; |
323 | } | 323 | } |
324 | 324 | ||
325 | nf_conntrack_expect_put(rtp_exp); | 325 | nf_ct_expect_put(rtp_exp); |
326 | nf_conntrack_expect_put(rtcp_exp); | 326 | nf_ct_expect_put(rtcp_exp); |
327 | 327 | ||
328 | return ret; | 328 | return ret; |
329 | } | 329 | } |
@@ -349,12 +349,12 @@ static int expect_t120(struct sk_buff **pskb, | |||
349 | return 0; | 349 | return 0; |
350 | 350 | ||
351 | /* Create expect for T.120 connections */ | 351 | /* Create expect for T.120 connections */ |
352 | if ((exp = nf_conntrack_expect_alloc(ct)) == NULL) | 352 | if ((exp = nf_ct_expect_alloc(ct)) == NULL) |
353 | return -1; | 353 | return -1; |
354 | nf_conntrack_expect_init(exp, ct->tuplehash[!dir].tuple.src.l3num, | 354 | nf_ct_expect_init(exp, ct->tuplehash[!dir].tuple.src.l3num, |
355 | &ct->tuplehash[!dir].tuple.src.u3, | 355 | &ct->tuplehash[!dir].tuple.src.u3, |
356 | &ct->tuplehash[!dir].tuple.dst.u3, | 356 | &ct->tuplehash[!dir].tuple.dst.u3, |
357 | IPPROTO_TCP, NULL, &port); | 357 | IPPROTO_TCP, NULL, &port); |
358 | exp->flags = NF_CT_EXPECT_PERMANENT; /* Accept multiple channels */ | 358 | exp->flags = NF_CT_EXPECT_PERMANENT; /* Accept multiple channels */ |
359 | 359 | ||
360 | if (memcmp(&ct->tuplehash[dir].tuple.src.u3, | 360 | if (memcmp(&ct->tuplehash[dir].tuple.src.u3, |
@@ -366,14 +366,14 @@ static int expect_t120(struct sk_buff **pskb, | |||
366 | ret = nat_t120(pskb, ct, ctinfo, data, dataoff, taddr, | 366 | ret = nat_t120(pskb, ct, ctinfo, data, dataoff, taddr, |
367 | port, exp); | 367 | port, exp); |
368 | } else { /* Conntrack only */ | 368 | } else { /* Conntrack only */ |
369 | if (nf_conntrack_expect_related(exp) == 0) { | 369 | if (nf_ct_expect_related(exp) == 0) { |
370 | DEBUGP("nf_ct_h323: expect T.120 "); | 370 | DEBUGP("nf_ct_h323: expect T.120 "); |
371 | NF_CT_DUMP_TUPLE(&exp->tuple); | 371 | NF_CT_DUMP_TUPLE(&exp->tuple); |
372 | } else | 372 | } else |
373 | ret = -1; | 373 | ret = -1; |
374 | } | 374 | } |
375 | 375 | ||
376 | nf_conntrack_expect_put(exp); | 376 | nf_ct_expect_put(exp); |
377 | 377 | ||
378 | return ret; | 378 | return ret; |
379 | } | 379 | } |
@@ -684,12 +684,12 @@ static int expect_h245(struct sk_buff **pskb, struct nf_conn *ct, | |||
684 | return 0; | 684 | return 0; |
685 | 685 | ||
686 | /* Create expect for h245 connection */ | 686 | /* Create expect for h245 connection */ |
687 | if ((exp = nf_conntrack_expect_alloc(ct)) == NULL) | 687 | if ((exp = nf_ct_expect_alloc(ct)) == NULL) |
688 | return -1; | 688 | return -1; |
689 | nf_conntrack_expect_init(exp, ct->tuplehash[!dir].tuple.src.l3num, | 689 | nf_ct_expect_init(exp, ct->tuplehash[!dir].tuple.src.l3num, |
690 | &ct->tuplehash[!dir].tuple.src.u3, | 690 | &ct->tuplehash[!dir].tuple.src.u3, |
691 | &ct->tuplehash[!dir].tuple.dst.u3, | 691 | &ct->tuplehash[!dir].tuple.dst.u3, |
692 | IPPROTO_TCP, NULL, &port); | 692 | IPPROTO_TCP, NULL, &port); |
693 | exp->helper = &nf_conntrack_helper_h245; | 693 | exp->helper = &nf_conntrack_helper_h245; |
694 | 694 | ||
695 | if (memcmp(&ct->tuplehash[dir].tuple.src.u3, | 695 | if (memcmp(&ct->tuplehash[dir].tuple.src.u3, |
@@ -701,14 +701,14 @@ static int expect_h245(struct sk_buff **pskb, struct nf_conn *ct, | |||
701 | ret = nat_h245(pskb, ct, ctinfo, data, dataoff, taddr, | 701 | ret = nat_h245(pskb, ct, ctinfo, data, dataoff, taddr, |
702 | port, exp); | 702 | port, exp); |
703 | } else { /* Conntrack only */ | 703 | } else { /* Conntrack only */ |
704 | if (nf_conntrack_expect_related(exp) == 0) { | 704 | if (nf_ct_expect_related(exp) == 0) { |
705 | DEBUGP("nf_ct_q931: expect H.245 "); | 705 | DEBUGP("nf_ct_q931: expect H.245 "); |
706 | NF_CT_DUMP_TUPLE(&exp->tuple); | 706 | NF_CT_DUMP_TUPLE(&exp->tuple); |
707 | } else | 707 | } else |
708 | ret = -1; | 708 | ret = -1; |
709 | } | 709 | } |
710 | 710 | ||
711 | nf_conntrack_expect_put(exp); | 711 | nf_ct_expect_put(exp); |
712 | 712 | ||
713 | return ret; | 713 | return ret; |
714 | } | 714 | } |
@@ -796,11 +796,11 @@ static int expect_callforwarding(struct sk_buff **pskb, | |||
796 | } | 796 | } |
797 | 797 | ||
798 | /* Create expect for the second call leg */ | 798 | /* Create expect for the second call leg */ |
799 | if ((exp = nf_conntrack_expect_alloc(ct)) == NULL) | 799 | if ((exp = nf_ct_expect_alloc(ct)) == NULL) |
800 | return -1; | 800 | return -1; |
801 | nf_conntrack_expect_init(exp, ct->tuplehash[!dir].tuple.src.l3num, | 801 | nf_ct_expect_init(exp, ct->tuplehash[!dir].tuple.src.l3num, |
802 | &ct->tuplehash[!dir].tuple.src.u3, &addr, | 802 | &ct->tuplehash[!dir].tuple.src.u3, &addr, |
803 | IPPROTO_TCP, NULL, &port); | 803 | IPPROTO_TCP, NULL, &port); |
804 | exp->helper = nf_conntrack_helper_q931; | 804 | exp->helper = nf_conntrack_helper_q931; |
805 | 805 | ||
806 | if (memcmp(&ct->tuplehash[dir].tuple.src.u3, | 806 | if (memcmp(&ct->tuplehash[dir].tuple.src.u3, |
@@ -812,14 +812,14 @@ static int expect_callforwarding(struct sk_buff **pskb, | |||
812 | ret = nat_callforwarding(pskb, ct, ctinfo, data, dataoff, | 812 | ret = nat_callforwarding(pskb, ct, ctinfo, data, dataoff, |
813 | taddr, port, exp); | 813 | taddr, port, exp); |
814 | } else { /* Conntrack only */ | 814 | } else { /* Conntrack only */ |
815 | if (nf_conntrack_expect_related(exp) == 0) { | 815 | if (nf_ct_expect_related(exp) == 0) { |
816 | DEBUGP("nf_ct_q931: expect Call Forwarding "); | 816 | DEBUGP("nf_ct_q931: expect Call Forwarding "); |
817 | NF_CT_DUMP_TUPLE(&exp->tuple); | 817 | NF_CT_DUMP_TUPLE(&exp->tuple); |
818 | } else | 818 | } else |
819 | ret = -1; | 819 | ret = -1; |
820 | } | 820 | } |
821 | 821 | ||
822 | nf_conntrack_expect_put(exp); | 822 | nf_ct_expect_put(exp); |
823 | 823 | ||
824 | return ret; | 824 | return ret; |
825 | } | 825 | } |
@@ -1225,7 +1225,7 @@ static struct nf_conntrack_expect *find_expect(struct nf_conn *ct, | |||
1225 | tuple.dst.u.tcp.port = port; | 1225 | tuple.dst.u.tcp.port = port; |
1226 | tuple.dst.protonum = IPPROTO_TCP; | 1226 | tuple.dst.protonum = IPPROTO_TCP; |
1227 | 1227 | ||
1228 | exp = __nf_conntrack_expect_find(&tuple); | 1228 | exp = __nf_ct_expect_find(&tuple); |
1229 | if (exp && exp->master == ct) | 1229 | if (exp && exp->master == ct) |
1230 | return exp; | 1230 | return exp; |
1231 | return NULL; | 1231 | return NULL; |
@@ -1271,14 +1271,13 @@ static int expect_q931(struct sk_buff **pskb, struct nf_conn *ct, | |||
1271 | return 0; | 1271 | return 0; |
1272 | 1272 | ||
1273 | /* Create expect for Q.931 */ | 1273 | /* Create expect for Q.931 */ |
1274 | if ((exp = nf_conntrack_expect_alloc(ct)) == NULL) | 1274 | if ((exp = nf_ct_expect_alloc(ct)) == NULL) |
1275 | return -1; | 1275 | return -1; |
1276 | nf_conntrack_expect_init(exp, ct->tuplehash[!dir].tuple.src.l3num, | 1276 | nf_ct_expect_init(exp, ct->tuplehash[!dir].tuple.src.l3num, |
1277 | gkrouted_only ? /* only accept calls from GK? */ | 1277 | gkrouted_only ? /* only accept calls from GK? */ |
1278 | &ct->tuplehash[!dir].tuple.src.u3 : | 1278 | &ct->tuplehash[!dir].tuple.src.u3 : NULL, |
1279 | NULL, | 1279 | &ct->tuplehash[!dir].tuple.dst.u3, |
1280 | &ct->tuplehash[!dir].tuple.dst.u3, | 1280 | IPPROTO_TCP, NULL, &port); |
1281 | IPPROTO_TCP, NULL, &port); | ||
1282 | exp->helper = nf_conntrack_helper_q931; | 1281 | exp->helper = nf_conntrack_helper_q931; |
1283 | exp->flags = NF_CT_EXPECT_PERMANENT; /* Accept multiple calls */ | 1282 | exp->flags = NF_CT_EXPECT_PERMANENT; /* Accept multiple calls */ |
1284 | 1283 | ||
@@ -1286,7 +1285,7 @@ static int expect_q931(struct sk_buff **pskb, struct nf_conn *ct, | |||
1286 | if (nat_q931 && ct->status & IPS_NAT_MASK) { /* Need NAT */ | 1285 | if (nat_q931 && ct->status & IPS_NAT_MASK) { /* Need NAT */ |
1287 | ret = nat_q931(pskb, ct, ctinfo, data, taddr, i, port, exp); | 1286 | ret = nat_q931(pskb, ct, ctinfo, data, taddr, i, port, exp); |
1288 | } else { /* Conntrack only */ | 1287 | } else { /* Conntrack only */ |
1289 | if (nf_conntrack_expect_related(exp) == 0) { | 1288 | if (nf_ct_expect_related(exp) == 0) { |
1290 | DEBUGP("nf_ct_ras: expect Q.931 "); | 1289 | DEBUGP("nf_ct_ras: expect Q.931 "); |
1291 | NF_CT_DUMP_TUPLE(&exp->tuple); | 1290 | NF_CT_DUMP_TUPLE(&exp->tuple); |
1292 | 1291 | ||
@@ -1296,7 +1295,7 @@ static int expect_q931(struct sk_buff **pskb, struct nf_conn *ct, | |||
1296 | ret = -1; | 1295 | ret = -1; |
1297 | } | 1296 | } |
1298 | 1297 | ||
1299 | nf_conntrack_expect_put(exp); | 1298 | nf_ct_expect_put(exp); |
1300 | 1299 | ||
1301 | return ret; | 1300 | return ret; |
1302 | } | 1301 | } |
@@ -1343,20 +1342,20 @@ static int process_gcf(struct sk_buff **pskb, struct nf_conn *ct, | |||
1343 | return 0; | 1342 | return 0; |
1344 | 1343 | ||
1345 | /* Need new expect */ | 1344 | /* Need new expect */ |
1346 | if ((exp = nf_conntrack_expect_alloc(ct)) == NULL) | 1345 | if ((exp = nf_ct_expect_alloc(ct)) == NULL) |
1347 | return -1; | 1346 | return -1; |
1348 | nf_conntrack_expect_init(exp, ct->tuplehash[!dir].tuple.src.l3num, | 1347 | nf_ct_expect_init(exp, ct->tuplehash[!dir].tuple.src.l3num, |
1349 | &ct->tuplehash[!dir].tuple.src.u3, &addr, | 1348 | &ct->tuplehash[!dir].tuple.src.u3, &addr, |
1350 | IPPROTO_UDP, NULL, &port); | 1349 | IPPROTO_UDP, NULL, &port); |
1351 | exp->helper = nf_conntrack_helper_ras; | 1350 | exp->helper = nf_conntrack_helper_ras; |
1352 | 1351 | ||
1353 | if (nf_conntrack_expect_related(exp) == 0) { | 1352 | if (nf_ct_expect_related(exp) == 0) { |
1354 | DEBUGP("nf_ct_ras: expect RAS "); | 1353 | DEBUGP("nf_ct_ras: expect RAS "); |
1355 | NF_CT_DUMP_TUPLE(&exp->tuple); | 1354 | NF_CT_DUMP_TUPLE(&exp->tuple); |
1356 | } else | 1355 | } else |
1357 | ret = -1; | 1356 | ret = -1; |
1358 | 1357 | ||
1359 | nf_conntrack_expect_put(exp); | 1358 | nf_ct_expect_put(exp); |
1360 | 1359 | ||
1361 | return ret; | 1360 | return ret; |
1362 | } | 1361 | } |
@@ -1548,21 +1547,21 @@ static int process_acf(struct sk_buff **pskb, struct nf_conn *ct, | |||
1548 | } | 1547 | } |
1549 | 1548 | ||
1550 | /* Need new expect */ | 1549 | /* Need new expect */ |
1551 | if ((exp = nf_conntrack_expect_alloc(ct)) == NULL) | 1550 | if ((exp = nf_ct_expect_alloc(ct)) == NULL) |
1552 | return -1; | 1551 | return -1; |
1553 | nf_conntrack_expect_init(exp, ct->tuplehash[!dir].tuple.src.l3num, | 1552 | nf_ct_expect_init(exp, ct->tuplehash[!dir].tuple.src.l3num, |
1554 | &ct->tuplehash[!dir].tuple.src.u3, &addr, | 1553 | &ct->tuplehash[!dir].tuple.src.u3, &addr, |
1555 | IPPROTO_TCP, NULL, &port); | 1554 | IPPROTO_TCP, NULL, &port); |
1556 | exp->flags = NF_CT_EXPECT_PERMANENT; | 1555 | exp->flags = NF_CT_EXPECT_PERMANENT; |
1557 | exp->helper = nf_conntrack_helper_q931; | 1556 | exp->helper = nf_conntrack_helper_q931; |
1558 | 1557 | ||
1559 | if (nf_conntrack_expect_related(exp) == 0) { | 1558 | if (nf_ct_expect_related(exp) == 0) { |
1560 | DEBUGP("nf_ct_ras: expect Q.931 "); | 1559 | DEBUGP("nf_ct_ras: expect Q.931 "); |
1561 | NF_CT_DUMP_TUPLE(&exp->tuple); | 1560 | NF_CT_DUMP_TUPLE(&exp->tuple); |
1562 | } else | 1561 | } else |
1563 | ret = -1; | 1562 | ret = -1; |
1564 | 1563 | ||
1565 | nf_conntrack_expect_put(exp); | 1564 | nf_ct_expect_put(exp); |
1566 | 1565 | ||
1567 | return ret; | 1566 | return ret; |
1568 | } | 1567 | } |
@@ -1601,21 +1600,21 @@ static int process_lcf(struct sk_buff **pskb, struct nf_conn *ct, | |||
1601 | return 0; | 1600 | return 0; |
1602 | 1601 | ||
1603 | /* Need new expect for call signal */ | 1602 | /* Need new expect for call signal */ |
1604 | if ((exp = nf_conntrack_expect_alloc(ct)) == NULL) | 1603 | if ((exp = nf_ct_expect_alloc(ct)) == NULL) |
1605 | return -1; | 1604 | return -1; |
1606 | nf_conntrack_expect_init(exp, ct->tuplehash[!dir].tuple.src.l3num, | 1605 | nf_ct_expect_init(exp, ct->tuplehash[!dir].tuple.src.l3num, |
1607 | &ct->tuplehash[!dir].tuple.src.u3, &addr, | 1606 | &ct->tuplehash[!dir].tuple.src.u3, &addr, |
1608 | IPPROTO_TCP, NULL, &port); | 1607 | IPPROTO_TCP, NULL, &port); |
1609 | exp->flags = NF_CT_EXPECT_PERMANENT; | 1608 | exp->flags = NF_CT_EXPECT_PERMANENT; |
1610 | exp->helper = nf_conntrack_helper_q931; | 1609 | exp->helper = nf_conntrack_helper_q931; |
1611 | 1610 | ||
1612 | if (nf_conntrack_expect_related(exp) == 0) { | 1611 | if (nf_ct_expect_related(exp) == 0) { |
1613 | DEBUGP("nf_ct_ras: expect Q.931 "); | 1612 | DEBUGP("nf_ct_ras: expect Q.931 "); |
1614 | NF_CT_DUMP_TUPLE(&exp->tuple); | 1613 | NF_CT_DUMP_TUPLE(&exp->tuple); |
1615 | } else | 1614 | } else |
1616 | ret = -1; | 1615 | ret = -1; |
1617 | 1616 | ||
1618 | nf_conntrack_expect_put(exp); | 1617 | nf_ct_expect_put(exp); |
1619 | 1618 | ||
1620 | /* Ignore rasAddress */ | 1619 | /* Ignore rasAddress */ |
1621 | 1620 | ||
diff --git a/net/netfilter/nf_conntrack_helper.c b/net/netfilter/nf_conntrack_helper.c index 3fc6e9f0de1a..89a5f7333d38 100644 --- a/net/netfilter/nf_conntrack_helper.c +++ b/net/netfilter/nf_conntrack_helper.c | |||
@@ -123,12 +123,12 @@ void nf_conntrack_helper_unregister(struct nf_conntrack_helper *me) | |||
123 | list_del(&me->list); | 123 | list_del(&me->list); |
124 | 124 | ||
125 | /* Get rid of expectations */ | 125 | /* Get rid of expectations */ |
126 | list_for_each_entry_safe(exp, tmp, &nf_conntrack_expect_list, list) { | 126 | list_for_each_entry_safe(exp, tmp, &nf_ct_expect_list, list) { |
127 | struct nf_conn_help *help = nfct_help(exp->master); | 127 | struct nf_conn_help *help = nfct_help(exp->master); |
128 | if ((help->helper == me || exp->helper == me) && | 128 | if ((help->helper == me || exp->helper == me) && |
129 | del_timer(&exp->timeout)) { | 129 | del_timer(&exp->timeout)) { |
130 | nf_ct_unlink_expect(exp); | 130 | nf_ct_unlink_expect(exp); |
131 | nf_conntrack_expect_put(exp); | 131 | nf_ct_expect_put(exp); |
132 | } | 132 | } |
133 | } | 133 | } |
134 | 134 | ||
diff --git a/net/netfilter/nf_conntrack_irc.c b/net/netfilter/nf_conntrack_irc.c index 43ccd0e2e8ae..79da93e4396b 100644 --- a/net/netfilter/nf_conntrack_irc.c +++ b/net/netfilter/nf_conntrack_irc.c | |||
@@ -184,16 +184,16 @@ static int help(struct sk_buff **pskb, unsigned int protoff, | |||
184 | continue; | 184 | continue; |
185 | } | 185 | } |
186 | 186 | ||
187 | exp = nf_conntrack_expect_alloc(ct); | 187 | exp = nf_ct_expect_alloc(ct); |
188 | if (exp == NULL) { | 188 | if (exp == NULL) { |
189 | ret = NF_DROP; | 189 | ret = NF_DROP; |
190 | goto out; | 190 | goto out; |
191 | } | 191 | } |
192 | tuple = &ct->tuplehash[!dir].tuple; | 192 | tuple = &ct->tuplehash[!dir].tuple; |
193 | port = htons(dcc_port); | 193 | port = htons(dcc_port); |
194 | nf_conntrack_expect_init(exp, tuple->src.l3num, | 194 | nf_ct_expect_init(exp, tuple->src.l3num, |
195 | NULL, &tuple->dst.u3, | 195 | NULL, &tuple->dst.u3, |
196 | IPPROTO_TCP, NULL, &port); | 196 | IPPROTO_TCP, NULL, &port); |
197 | 197 | ||
198 | nf_nat_irc = rcu_dereference(nf_nat_irc_hook); | 198 | nf_nat_irc = rcu_dereference(nf_nat_irc_hook); |
199 | if (nf_nat_irc && ct->status & IPS_NAT_MASK) | 199 | if (nf_nat_irc && ct->status & IPS_NAT_MASK) |
@@ -201,9 +201,9 @@ static int help(struct sk_buff **pskb, unsigned int protoff, | |||
201 | addr_beg_p - ib_ptr, | 201 | addr_beg_p - ib_ptr, |
202 | addr_end_p - addr_beg_p, | 202 | addr_end_p - addr_beg_p, |
203 | exp); | 203 | exp); |
204 | else if (nf_conntrack_expect_related(exp) != 0) | 204 | else if (nf_ct_expect_related(exp) != 0) |
205 | ret = NF_DROP; | 205 | ret = NF_DROP; |
206 | nf_conntrack_expect_put(exp); | 206 | nf_ct_expect_put(exp); |
207 | goto out; | 207 | goto out; |
208 | } | 208 | } |
209 | } | 209 | } |
diff --git a/net/netfilter/nf_conntrack_netbios_ns.c b/net/netfilter/nf_conntrack_netbios_ns.c index 1093478cc007..ea585c789a83 100644 --- a/net/netfilter/nf_conntrack_netbios_ns.c +++ b/net/netfilter/nf_conntrack_netbios_ns.c | |||
@@ -74,7 +74,7 @@ static int help(struct sk_buff **pskb, unsigned int protoff, | |||
74 | if (mask == 0) | 74 | if (mask == 0) |
75 | goto out; | 75 | goto out; |
76 | 76 | ||
77 | exp = nf_conntrack_expect_alloc(ct); | 77 | exp = nf_ct_expect_alloc(ct); |
78 | if (exp == NULL) | 78 | if (exp == NULL) |
79 | goto out; | 79 | goto out; |
80 | 80 | ||
@@ -91,8 +91,8 @@ static int help(struct sk_buff **pskb, unsigned int protoff, | |||
91 | exp->flags = NF_CT_EXPECT_PERMANENT; | 91 | exp->flags = NF_CT_EXPECT_PERMANENT; |
92 | exp->helper = NULL; | 92 | exp->helper = NULL; |
93 | 93 | ||
94 | nf_conntrack_expect_related(exp); | 94 | nf_ct_expect_related(exp); |
95 | nf_conntrack_expect_put(exp); | 95 | nf_ct_expect_put(exp); |
96 | 96 | ||
97 | nf_ct_refresh(ct, *pskb, timeout * HZ); | 97 | nf_ct_refresh(ct, *pskb, timeout * HZ); |
98 | out: | 98 | out: |
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index d310ec866194..954cc58b9d04 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c | |||
@@ -1239,7 +1239,7 @@ ctnetlink_exp_dump_table(struct sk_buff *skb, struct netlink_callback *cb) | |||
1239 | u_int8_t l3proto = nfmsg->nfgen_family; | 1239 | u_int8_t l3proto = nfmsg->nfgen_family; |
1240 | 1240 | ||
1241 | read_lock_bh(&nf_conntrack_lock); | 1241 | read_lock_bh(&nf_conntrack_lock); |
1242 | list_for_each_prev(i, &nf_conntrack_expect_list) { | 1242 | list_for_each_prev(i, &nf_ct_expect_list) { |
1243 | exp = (struct nf_conntrack_expect *) i; | 1243 | exp = (struct nf_conntrack_expect *) i; |
1244 | if (l3proto && exp->tuple.src.l3num != l3proto) | 1244 | if (l3proto && exp->tuple.src.l3num != l3proto) |
1245 | continue; | 1245 | continue; |
@@ -1291,14 +1291,14 @@ ctnetlink_get_expect(struct sock *ctnl, struct sk_buff *skb, | |||
1291 | if (err < 0) | 1291 | if (err < 0) |
1292 | return err; | 1292 | return err; |
1293 | 1293 | ||
1294 | exp = nf_conntrack_expect_find_get(&tuple); | 1294 | exp = nf_ct_expect_find_get(&tuple); |
1295 | if (!exp) | 1295 | if (!exp) |
1296 | return -ENOENT; | 1296 | return -ENOENT; |
1297 | 1297 | ||
1298 | if (cda[CTA_EXPECT_ID-1]) { | 1298 | if (cda[CTA_EXPECT_ID-1]) { |
1299 | __be32 id = *(__be32 *)NFA_DATA(cda[CTA_EXPECT_ID-1]); | 1299 | __be32 id = *(__be32 *)NFA_DATA(cda[CTA_EXPECT_ID-1]); |
1300 | if (exp->id != ntohl(id)) { | 1300 | if (exp->id != ntohl(id)) { |
1301 | nf_conntrack_expect_put(exp); | 1301 | nf_ct_expect_put(exp); |
1302 | return -ENOENT; | 1302 | return -ENOENT; |
1303 | } | 1303 | } |
1304 | } | 1304 | } |
@@ -1314,14 +1314,14 @@ ctnetlink_get_expect(struct sock *ctnl, struct sk_buff *skb, | |||
1314 | if (err <= 0) | 1314 | if (err <= 0) |
1315 | goto free; | 1315 | goto free; |
1316 | 1316 | ||
1317 | nf_conntrack_expect_put(exp); | 1317 | nf_ct_expect_put(exp); |
1318 | 1318 | ||
1319 | return netlink_unicast(ctnl, skb2, NETLINK_CB(skb).pid, MSG_DONTWAIT); | 1319 | return netlink_unicast(ctnl, skb2, NETLINK_CB(skb).pid, MSG_DONTWAIT); |
1320 | 1320 | ||
1321 | free: | 1321 | free: |
1322 | kfree_skb(skb2); | 1322 | kfree_skb(skb2); |
1323 | out: | 1323 | out: |
1324 | nf_conntrack_expect_put(exp); | 1324 | nf_ct_expect_put(exp); |
1325 | return err; | 1325 | return err; |
1326 | } | 1326 | } |
1327 | 1327 | ||
@@ -1346,23 +1346,23 @@ ctnetlink_del_expect(struct sock *ctnl, struct sk_buff *skb, | |||
1346 | return err; | 1346 | return err; |
1347 | 1347 | ||
1348 | /* bump usage count to 2 */ | 1348 | /* bump usage count to 2 */ |
1349 | exp = nf_conntrack_expect_find_get(&tuple); | 1349 | exp = nf_ct_expect_find_get(&tuple); |
1350 | if (!exp) | 1350 | if (!exp) |
1351 | return -ENOENT; | 1351 | return -ENOENT; |
1352 | 1352 | ||
1353 | if (cda[CTA_EXPECT_ID-1]) { | 1353 | if (cda[CTA_EXPECT_ID-1]) { |
1354 | __be32 id = *(__be32 *)NFA_DATA(cda[CTA_EXPECT_ID-1]); | 1354 | __be32 id = *(__be32 *)NFA_DATA(cda[CTA_EXPECT_ID-1]); |
1355 | if (exp->id != ntohl(id)) { | 1355 | if (exp->id != ntohl(id)) { |
1356 | nf_conntrack_expect_put(exp); | 1356 | nf_ct_expect_put(exp); |
1357 | return -ENOENT; | 1357 | return -ENOENT; |
1358 | } | 1358 | } |
1359 | } | 1359 | } |
1360 | 1360 | ||
1361 | /* after list removal, usage count == 1 */ | 1361 | /* after list removal, usage count == 1 */ |
1362 | nf_conntrack_unexpect_related(exp); | 1362 | nf_ct_unexpect_related(exp); |
1363 | /* have to put what we 'get' above. | 1363 | /* have to put what we 'get' above. |
1364 | * after this line usage count == 0 */ | 1364 | * after this line usage count == 0 */ |
1365 | nf_conntrack_expect_put(exp); | 1365 | nf_ct_expect_put(exp); |
1366 | } else if (cda[CTA_EXPECT_HELP_NAME-1]) { | 1366 | } else if (cda[CTA_EXPECT_HELP_NAME-1]) { |
1367 | char *name = NFA_DATA(cda[CTA_EXPECT_HELP_NAME-1]); | 1367 | char *name = NFA_DATA(cda[CTA_EXPECT_HELP_NAME-1]); |
1368 | 1368 | ||
@@ -1373,24 +1373,22 @@ ctnetlink_del_expect(struct sock *ctnl, struct sk_buff *skb, | |||
1373 | write_unlock_bh(&nf_conntrack_lock); | 1373 | write_unlock_bh(&nf_conntrack_lock); |
1374 | return -EINVAL; | 1374 | return -EINVAL; |
1375 | } | 1375 | } |
1376 | list_for_each_entry_safe(exp, tmp, &nf_conntrack_expect_list, | 1376 | list_for_each_entry_safe(exp, tmp, &nf_ct_expect_list, list) { |
1377 | list) { | ||
1378 | struct nf_conn_help *m_help = nfct_help(exp->master); | 1377 | struct nf_conn_help *m_help = nfct_help(exp->master); |
1379 | if (m_help->helper == h | 1378 | if (m_help->helper == h |
1380 | && del_timer(&exp->timeout)) { | 1379 | && del_timer(&exp->timeout)) { |
1381 | nf_ct_unlink_expect(exp); | 1380 | nf_ct_unlink_expect(exp); |
1382 | nf_conntrack_expect_put(exp); | 1381 | nf_ct_expect_put(exp); |
1383 | } | 1382 | } |
1384 | } | 1383 | } |
1385 | write_unlock_bh(&nf_conntrack_lock); | 1384 | write_unlock_bh(&nf_conntrack_lock); |
1386 | } else { | 1385 | } else { |
1387 | /* This basically means we have to flush everything*/ | 1386 | /* This basically means we have to flush everything*/ |
1388 | write_lock_bh(&nf_conntrack_lock); | 1387 | write_lock_bh(&nf_conntrack_lock); |
1389 | list_for_each_entry_safe(exp, tmp, &nf_conntrack_expect_list, | 1388 | list_for_each_entry_safe(exp, tmp, &nf_ct_expect_list, list) { |
1390 | list) { | ||
1391 | if (del_timer(&exp->timeout)) { | 1389 | if (del_timer(&exp->timeout)) { |
1392 | nf_ct_unlink_expect(exp); | 1390 | nf_ct_unlink_expect(exp); |
1393 | nf_conntrack_expect_put(exp); | 1391 | nf_ct_expect_put(exp); |
1394 | } | 1392 | } |
1395 | } | 1393 | } |
1396 | write_unlock_bh(&nf_conntrack_lock); | 1394 | write_unlock_bh(&nf_conntrack_lock); |
@@ -1438,7 +1436,7 @@ ctnetlink_create_expect(struct nfattr *cda[], u_int8_t u3) | |||
1438 | goto out; | 1436 | goto out; |
1439 | } | 1437 | } |
1440 | 1438 | ||
1441 | exp = nf_conntrack_expect_alloc(ct); | 1439 | exp = nf_ct_expect_alloc(ct); |
1442 | if (!exp) { | 1440 | if (!exp) { |
1443 | err = -ENOMEM; | 1441 | err = -ENOMEM; |
1444 | goto out; | 1442 | goto out; |
@@ -1451,8 +1449,8 @@ ctnetlink_create_expect(struct nfattr *cda[], u_int8_t u3) | |||
1451 | memcpy(&exp->tuple, &tuple, sizeof(struct nf_conntrack_tuple)); | 1449 | memcpy(&exp->tuple, &tuple, sizeof(struct nf_conntrack_tuple)); |
1452 | memcpy(&exp->mask, &mask, sizeof(struct nf_conntrack_tuple)); | 1450 | memcpy(&exp->mask, &mask, sizeof(struct nf_conntrack_tuple)); |
1453 | 1451 | ||
1454 | err = nf_conntrack_expect_related(exp); | 1452 | err = nf_ct_expect_related(exp); |
1455 | nf_conntrack_expect_put(exp); | 1453 | nf_ct_expect_put(exp); |
1456 | 1454 | ||
1457 | out: | 1455 | out: |
1458 | nf_ct_put(nf_ct_tuplehash_to_ctrack(h)); | 1456 | nf_ct_put(nf_ct_tuplehash_to_ctrack(h)); |
@@ -1482,7 +1480,7 @@ ctnetlink_new_expect(struct sock *ctnl, struct sk_buff *skb, | |||
1482 | return err; | 1480 | return err; |
1483 | 1481 | ||
1484 | write_lock_bh(&nf_conntrack_lock); | 1482 | write_lock_bh(&nf_conntrack_lock); |
1485 | exp = __nf_conntrack_expect_find(&tuple); | 1483 | exp = __nf_ct_expect_find(&tuple); |
1486 | 1484 | ||
1487 | if (!exp) { | 1485 | if (!exp) { |
1488 | write_unlock_bh(&nf_conntrack_lock); | 1486 | write_unlock_bh(&nf_conntrack_lock); |
@@ -1572,7 +1570,7 @@ static int __init ctnetlink_init(void) | |||
1572 | goto err_unreg_exp_subsys; | 1570 | goto err_unreg_exp_subsys; |
1573 | } | 1571 | } |
1574 | 1572 | ||
1575 | ret = nf_conntrack_expect_register_notifier(&ctnl_notifier_exp); | 1573 | ret = nf_ct_expect_register_notifier(&ctnl_notifier_exp); |
1576 | if (ret < 0) { | 1574 | if (ret < 0) { |
1577 | printk("ctnetlink_init: cannot expect register notifier.\n"); | 1575 | printk("ctnetlink_init: cannot expect register notifier.\n"); |
1578 | goto err_unreg_notifier; | 1576 | goto err_unreg_notifier; |
@@ -1598,7 +1596,7 @@ static void __exit ctnetlink_exit(void) | |||
1598 | printk("ctnetlink: unregistering from nfnetlink.\n"); | 1596 | printk("ctnetlink: unregistering from nfnetlink.\n"); |
1599 | 1597 | ||
1600 | #ifdef CONFIG_NF_CONNTRACK_EVENTS | 1598 | #ifdef CONFIG_NF_CONNTRACK_EVENTS |
1601 | nf_conntrack_expect_unregister_notifier(&ctnl_notifier_exp); | 1599 | nf_ct_expect_unregister_notifier(&ctnl_notifier_exp); |
1602 | nf_conntrack_unregister_notifier(&ctnl_notifier); | 1600 | nf_conntrack_unregister_notifier(&ctnl_notifier); |
1603 | #endif | 1601 | #endif |
1604 | 1602 | ||
diff --git a/net/netfilter/nf_conntrack_pptp.c b/net/netfilter/nf_conntrack_pptp.c index da36c48177e9..916e106d36bc 100644 --- a/net/netfilter/nf_conntrack_pptp.c +++ b/net/netfilter/nf_conntrack_pptp.c | |||
@@ -124,12 +124,12 @@ static void pptp_expectfn(struct nf_conn *ct, | |||
124 | DEBUGP("trying to unexpect other dir: "); | 124 | DEBUGP("trying to unexpect other dir: "); |
125 | NF_CT_DUMP_TUPLE(&inv_t); | 125 | NF_CT_DUMP_TUPLE(&inv_t); |
126 | 126 | ||
127 | exp_other = nf_conntrack_expect_find_get(&inv_t); | 127 | exp_other = nf_ct_expect_find_get(&inv_t); |
128 | if (exp_other) { | 128 | if (exp_other) { |
129 | /* delete other expectation. */ | 129 | /* delete other expectation. */ |
130 | DEBUGP("found\n"); | 130 | DEBUGP("found\n"); |
131 | nf_conntrack_unexpect_related(exp_other); | 131 | nf_ct_unexpect_related(exp_other); |
132 | nf_conntrack_expect_put(exp_other); | 132 | nf_ct_expect_put(exp_other); |
133 | } else { | 133 | } else { |
134 | DEBUGP("not found\n"); | 134 | DEBUGP("not found\n"); |
135 | } | 135 | } |
@@ -157,11 +157,11 @@ static int destroy_sibling_or_exp(const struct nf_conntrack_tuple *t) | |||
157 | nf_ct_put(sibling); | 157 | nf_ct_put(sibling); |
158 | return 1; | 158 | return 1; |
159 | } else { | 159 | } else { |
160 | exp = nf_conntrack_expect_find_get(t); | 160 | exp = nf_ct_expect_find_get(t); |
161 | if (exp) { | 161 | if (exp) { |
162 | DEBUGP("unexpect_related of expect %p\n", exp); | 162 | DEBUGP("unexpect_related of expect %p\n", exp); |
163 | nf_conntrack_unexpect_related(exp); | 163 | nf_ct_unexpect_related(exp); |
164 | nf_conntrack_expect_put(exp); | 164 | nf_ct_expect_put(exp); |
165 | return 1; | 165 | return 1; |
166 | } | 166 | } |
167 | } | 167 | } |
@@ -201,36 +201,36 @@ static int exp_gre(struct nf_conn *ct, __be16 callid, __be16 peer_callid) | |||
201 | int ret = 1; | 201 | int ret = 1; |
202 | typeof(nf_nat_pptp_hook_exp_gre) nf_nat_pptp_exp_gre; | 202 | typeof(nf_nat_pptp_hook_exp_gre) nf_nat_pptp_exp_gre; |
203 | 203 | ||
204 | exp_orig = nf_conntrack_expect_alloc(ct); | 204 | exp_orig = nf_ct_expect_alloc(ct); |
205 | if (exp_orig == NULL) | 205 | if (exp_orig == NULL) |
206 | goto out; | 206 | goto out; |
207 | 207 | ||
208 | exp_reply = nf_conntrack_expect_alloc(ct); | 208 | exp_reply = nf_ct_expect_alloc(ct); |
209 | if (exp_reply == NULL) | 209 | if (exp_reply == NULL) |
210 | goto out_put_orig; | 210 | goto out_put_orig; |
211 | 211 | ||
212 | /* original direction, PNS->PAC */ | 212 | /* original direction, PNS->PAC */ |
213 | dir = IP_CT_DIR_ORIGINAL; | 213 | dir = IP_CT_DIR_ORIGINAL; |
214 | nf_conntrack_expect_init(exp_orig, ct->tuplehash[dir].tuple.src.l3num, | 214 | nf_ct_expect_init(exp_orig, ct->tuplehash[dir].tuple.src.l3num, |
215 | &ct->tuplehash[dir].tuple.src.u3, | 215 | &ct->tuplehash[dir].tuple.src.u3, |
216 | &ct->tuplehash[dir].tuple.dst.u3, | 216 | &ct->tuplehash[dir].tuple.dst.u3, |
217 | IPPROTO_GRE, &peer_callid, &callid); | 217 | IPPROTO_GRE, &peer_callid, &callid); |
218 | exp_orig->expectfn = pptp_expectfn; | 218 | exp_orig->expectfn = pptp_expectfn; |
219 | 219 | ||
220 | /* reply direction, PAC->PNS */ | 220 | /* reply direction, PAC->PNS */ |
221 | dir = IP_CT_DIR_REPLY; | 221 | dir = IP_CT_DIR_REPLY; |
222 | nf_conntrack_expect_init(exp_reply, ct->tuplehash[dir].tuple.src.l3num, | 222 | nf_ct_expect_init(exp_reply, ct->tuplehash[dir].tuple.src.l3num, |
223 | &ct->tuplehash[dir].tuple.src.u3, | 223 | &ct->tuplehash[dir].tuple.src.u3, |
224 | &ct->tuplehash[dir].tuple.dst.u3, | 224 | &ct->tuplehash[dir].tuple.dst.u3, |
225 | IPPROTO_GRE, &callid, &peer_callid); | 225 | IPPROTO_GRE, &callid, &peer_callid); |
226 | exp_reply->expectfn = pptp_expectfn; | 226 | exp_reply->expectfn = pptp_expectfn; |
227 | 227 | ||
228 | nf_nat_pptp_exp_gre = rcu_dereference(nf_nat_pptp_hook_exp_gre); | 228 | nf_nat_pptp_exp_gre = rcu_dereference(nf_nat_pptp_hook_exp_gre); |
229 | if (nf_nat_pptp_exp_gre && ct->status & IPS_NAT_MASK) | 229 | if (nf_nat_pptp_exp_gre && ct->status & IPS_NAT_MASK) |
230 | nf_nat_pptp_exp_gre(exp_orig, exp_reply); | 230 | nf_nat_pptp_exp_gre(exp_orig, exp_reply); |
231 | if (nf_conntrack_expect_related(exp_orig) != 0) | 231 | if (nf_ct_expect_related(exp_orig) != 0) |
232 | goto out_put_both; | 232 | goto out_put_both; |
233 | if (nf_conntrack_expect_related(exp_reply) != 0) | 233 | if (nf_ct_expect_related(exp_reply) != 0) |
234 | goto out_unexpect_orig; | 234 | goto out_unexpect_orig; |
235 | 235 | ||
236 | /* Add GRE keymap entries */ | 236 | /* Add GRE keymap entries */ |
@@ -243,16 +243,16 @@ static int exp_gre(struct nf_conn *ct, __be16 callid, __be16 peer_callid) | |||
243 | ret = 0; | 243 | ret = 0; |
244 | 244 | ||
245 | out_put_both: | 245 | out_put_both: |
246 | nf_conntrack_expect_put(exp_reply); | 246 | nf_ct_expect_put(exp_reply); |
247 | out_put_orig: | 247 | out_put_orig: |
248 | nf_conntrack_expect_put(exp_orig); | 248 | nf_ct_expect_put(exp_orig); |
249 | out: | 249 | out: |
250 | return ret; | 250 | return ret; |
251 | 251 | ||
252 | out_unexpect_both: | 252 | out_unexpect_both: |
253 | nf_conntrack_unexpect_related(exp_reply); | 253 | nf_ct_unexpect_related(exp_reply); |
254 | out_unexpect_orig: | 254 | out_unexpect_orig: |
255 | nf_conntrack_unexpect_related(exp_orig); | 255 | nf_ct_unexpect_related(exp_orig); |
256 | goto out_put_both; | 256 | goto out_put_both; |
257 | } | 257 | } |
258 | 258 | ||
diff --git a/net/netfilter/nf_conntrack_sane.c b/net/netfilter/nf_conntrack_sane.c index eb2d1dc46d45..28ed303c565b 100644 --- a/net/netfilter/nf_conntrack_sane.c +++ b/net/netfilter/nf_conntrack_sane.c | |||
@@ -141,27 +141,25 @@ static int help(struct sk_buff **pskb, | |||
141 | if (reply->zero != 0) | 141 | if (reply->zero != 0) |
142 | goto out; | 142 | goto out; |
143 | 143 | ||
144 | exp = nf_conntrack_expect_alloc(ct); | 144 | exp = nf_ct_expect_alloc(ct); |
145 | if (exp == NULL) { | 145 | if (exp == NULL) { |
146 | ret = NF_DROP; | 146 | ret = NF_DROP; |
147 | goto out; | 147 | goto out; |
148 | } | 148 | } |
149 | 149 | ||
150 | tuple = &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple; | 150 | tuple = &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple; |
151 | nf_conntrack_expect_init(exp, family, | 151 | nf_ct_expect_init(exp, family, &tuple->src.u3, &tuple->dst.u3, |
152 | &tuple->src.u3, &tuple->dst.u3, | 152 | IPPROTO_TCP, NULL, &reply->port); |
153 | IPPROTO_TCP, | ||
154 | NULL, &reply->port); | ||
155 | 153 | ||
156 | DEBUGP("nf_ct_sane: expect: "); | 154 | DEBUGP("nf_ct_sane: expect: "); |
157 | NF_CT_DUMP_TUPLE(&exp->tuple); | 155 | NF_CT_DUMP_TUPLE(&exp->tuple); |
158 | NF_CT_DUMP_TUPLE(&exp->mask); | 156 | NF_CT_DUMP_TUPLE(&exp->mask); |
159 | 157 | ||
160 | /* Can't expect this? Best to drop packet now. */ | 158 | /* Can't expect this? Best to drop packet now. */ |
161 | if (nf_conntrack_expect_related(exp) != 0) | 159 | if (nf_ct_expect_related(exp) != 0) |
162 | ret = NF_DROP; | 160 | ret = NF_DROP; |
163 | 161 | ||
164 | nf_conntrack_expect_put(exp); | 162 | nf_ct_expect_put(exp); |
165 | 163 | ||
166 | out: | 164 | out: |
167 | spin_unlock_bh(&nf_sane_lock); | 165 | spin_unlock_bh(&nf_sane_lock); |
diff --git a/net/netfilter/nf_conntrack_sip.c b/net/netfilter/nf_conntrack_sip.c index 1b5c6c1055f7..1f17f8040cd2 100644 --- a/net/netfilter/nf_conntrack_sip.c +++ b/net/netfilter/nf_conntrack_sip.c | |||
@@ -378,23 +378,23 @@ static int set_expected_rtp(struct sk_buff **pskb, | |||
378 | int ret; | 378 | int ret; |
379 | typeof(nf_nat_sdp_hook) nf_nat_sdp; | 379 | typeof(nf_nat_sdp_hook) nf_nat_sdp; |
380 | 380 | ||
381 | exp = nf_conntrack_expect_alloc(ct); | 381 | exp = nf_ct_expect_alloc(ct); |
382 | if (exp == NULL) | 382 | if (exp == NULL) |
383 | return NF_DROP; | 383 | return NF_DROP; |
384 | nf_conntrack_expect_init(exp, family, | 384 | nf_ct_expect_init(exp, family, |
385 | &ct->tuplehash[!dir].tuple.src.u3, addr, | 385 | &ct->tuplehash[!dir].tuple.src.u3, addr, |
386 | IPPROTO_UDP, NULL, &port); | 386 | IPPROTO_UDP, NULL, &port); |
387 | 387 | ||
388 | nf_nat_sdp = rcu_dereference(nf_nat_sdp_hook); | 388 | nf_nat_sdp = rcu_dereference(nf_nat_sdp_hook); |
389 | if (nf_nat_sdp && ct->status & IPS_NAT_MASK) | 389 | if (nf_nat_sdp && ct->status & IPS_NAT_MASK) |
390 | ret = nf_nat_sdp(pskb, ctinfo, exp, dptr); | 390 | ret = nf_nat_sdp(pskb, ctinfo, exp, dptr); |
391 | else { | 391 | else { |
392 | if (nf_conntrack_expect_related(exp) != 0) | 392 | if (nf_ct_expect_related(exp) != 0) |
393 | ret = NF_DROP; | 393 | ret = NF_DROP; |
394 | else | 394 | else |
395 | ret = NF_ACCEPT; | 395 | ret = NF_ACCEPT; |
396 | } | 396 | } |
397 | nf_conntrack_expect_put(exp); | 397 | nf_ct_expect_put(exp); |
398 | 398 | ||
399 | return ret; | 399 | return ret; |
400 | } | 400 | } |
diff --git a/net/netfilter/nf_conntrack_tftp.c b/net/netfilter/nf_conntrack_tftp.c index 37c4542e3112..53d57b4c0de7 100644 --- a/net/netfilter/nf_conntrack_tftp.c +++ b/net/netfilter/nf_conntrack_tftp.c | |||
@@ -66,14 +66,12 @@ static int tftp_help(struct sk_buff **pskb, | |||
66 | NF_CT_DUMP_TUPLE(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple); | 66 | NF_CT_DUMP_TUPLE(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple); |
67 | NF_CT_DUMP_TUPLE(&ct->tuplehash[IP_CT_DIR_REPLY].tuple); | 67 | NF_CT_DUMP_TUPLE(&ct->tuplehash[IP_CT_DIR_REPLY].tuple); |
68 | 68 | ||
69 | exp = nf_conntrack_expect_alloc(ct); | 69 | exp = nf_ct_expect_alloc(ct); |
70 | if (exp == NULL) | 70 | if (exp == NULL) |
71 | return NF_DROP; | 71 | return NF_DROP; |
72 | tuple = &ct->tuplehash[IP_CT_DIR_REPLY].tuple; | 72 | tuple = &ct->tuplehash[IP_CT_DIR_REPLY].tuple; |
73 | nf_conntrack_expect_init(exp, family, | 73 | nf_ct_expect_init(exp, family, &tuple->src.u3, &tuple->dst.u3, |
74 | &tuple->src.u3, &tuple->dst.u3, | 74 | IPPROTO_UDP, NULL, &tuple->dst.u.udp.port); |
75 | IPPROTO_UDP, | ||
76 | NULL, &tuple->dst.u.udp.port); | ||
77 | 75 | ||
78 | DEBUGP("expect: "); | 76 | DEBUGP("expect: "); |
79 | NF_CT_DUMP_TUPLE(&exp->tuple); | 77 | NF_CT_DUMP_TUPLE(&exp->tuple); |
@@ -82,9 +80,9 @@ static int tftp_help(struct sk_buff **pskb, | |||
82 | nf_nat_tftp = rcu_dereference(nf_nat_tftp_hook); | 80 | nf_nat_tftp = rcu_dereference(nf_nat_tftp_hook); |
83 | if (nf_nat_tftp && ct->status & IPS_NAT_MASK) | 81 | if (nf_nat_tftp && ct->status & IPS_NAT_MASK) |
84 | ret = nf_nat_tftp(pskb, ctinfo, exp); | 82 | ret = nf_nat_tftp(pskb, ctinfo, exp); |
85 | else if (nf_conntrack_expect_related(exp) != 0) | 83 | else if (nf_ct_expect_related(exp) != 0) |
86 | ret = NF_DROP; | 84 | ret = NF_DROP; |
87 | nf_conntrack_expect_put(exp); | 85 | nf_ct_expect_put(exp); |
88 | break; | 86 | break; |
89 | case TFTP_OPCODE_DATA: | 87 | case TFTP_OPCODE_DATA: |
90 | case TFTP_OPCODE_ACK: | 88 | case TFTP_OPCODE_ACK: |