aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/appletalk/atalk_proc.c15
-rw-r--r--net/atm/br2684.c4
-rw-r--r--net/atm/clip.c4
-rw-r--r--net/atm/lec.c4
-rw-r--r--net/atm/mpoa_proc.c3
-rw-r--r--net/atm/proc.c8
-rw-r--r--net/ipv4/ip_gre.c14
-rw-r--r--net/ipv4/ipcomp.c5
-rw-r--r--net/ipv4/ipip.c14
-rw-r--r--net/ipv6/ip6_tunnel.c15
-rw-r--r--net/ipv6/ipcomp6.c2
-rw-r--r--net/ipv6/sit.c13
-rw-r--r--net/ipv6/sysctl_net_ipv6.c3
-rw-r--r--net/mac80211/ieee80211_sta.c7
-rw-r--r--net/netfilter/nf_conntrack_core.c15
-rw-r--r--net/netfilter/xt_conntrack.c4
16 files changed, 78 insertions, 52 deletions
diff --git a/net/appletalk/atalk_proc.c b/net/appletalk/atalk_proc.c
index 8e8dcfd532db..162199a2d74f 100644
--- a/net/appletalk/atalk_proc.c
+++ b/net/appletalk/atalk_proc.c
@@ -283,25 +283,24 @@ int __init atalk_proc_init(void)
283 goto out; 283 goto out;
284 atalk_proc_dir->owner = THIS_MODULE; 284 atalk_proc_dir->owner = THIS_MODULE;
285 285
286 p = create_proc_entry("interface", S_IRUGO, atalk_proc_dir); 286 p = proc_create("interface", S_IRUGO, atalk_proc_dir,
287 &atalk_seq_interface_fops);
287 if (!p) 288 if (!p)
288 goto out_interface; 289 goto out_interface;
289 p->proc_fops = &atalk_seq_interface_fops;
290 290
291 p = create_proc_entry("route", S_IRUGO, atalk_proc_dir); 291 p = proc_create("route", S_IRUGO, atalk_proc_dir,
292 &atalk_seq_route_fops);
292 if (!p) 293 if (!p)
293 goto out_route; 294 goto out_route;
294 p->proc_fops = &atalk_seq_route_fops;
295 295
296 p = create_proc_entry("socket", S_IRUGO, atalk_proc_dir); 296 p = proc_create("socket", S_IRUGO, atalk_proc_dir,
297 &atalk_seq_socket_fops);
297 if (!p) 298 if (!p)
298 goto out_socket; 299 goto out_socket;
299 p->proc_fops = &atalk_seq_socket_fops;
300 300
301 p = create_proc_entry("arp", S_IRUGO, atalk_proc_dir); 301 p = proc_create("arp", S_IRUGO, atalk_proc_dir, &atalk_seq_arp_fops);
302 if (!p) 302 if (!p)
303 goto out_arp; 303 goto out_arp;
304 p->proc_fops = &atalk_seq_arp_fops;
305 304
306 rc = 0; 305 rc = 0;
307out: 306out:
diff --git a/net/atm/br2684.c b/net/atm/br2684.c
index 574d9a964176..1b228065e745 100644
--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -742,9 +742,9 @@ static int __init br2684_init(void)
742{ 742{
743#ifdef CONFIG_PROC_FS 743#ifdef CONFIG_PROC_FS
744 struct proc_dir_entry *p; 744 struct proc_dir_entry *p;
745 if ((p = create_proc_entry("br2684", 0, atm_proc_root)) == NULL) 745 p = proc_create("br2684", 0, atm_proc_root, &br2684_proc_ops);
746 if (p == NULL)
746 return -ENOMEM; 747 return -ENOMEM;
747 p->proc_fops = &br2684_proc_ops;
748#endif 748#endif
749 register_atm_ioctl(&br2684_ioctl_ops); 749 register_atm_ioctl(&br2684_ioctl_ops);
750 return 0; 750 return 0;
diff --git a/net/atm/clip.c b/net/atm/clip.c
index 86b885ec1cbd..d30167c0b48e 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -962,9 +962,7 @@ static int __init atm_clip_init(void)
962 { 962 {
963 struct proc_dir_entry *p; 963 struct proc_dir_entry *p;
964 964
965 p = create_proc_entry("arp", S_IRUGO, atm_proc_root); 965 p = proc_create("arp", S_IRUGO, atm_proc_root, &arp_seq_fops);
966 if (p)
967 p->proc_fops = &arp_seq_fops;
968 } 966 }
969#endif 967#endif
970 968
diff --git a/net/atm/lec.c b/net/atm/lec.c
index 1a8c4c6c0cd0..0e450d12f035 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -1249,9 +1249,7 @@ static int __init lane_module_init(void)
1249#ifdef CONFIG_PROC_FS 1249#ifdef CONFIG_PROC_FS
1250 struct proc_dir_entry *p; 1250 struct proc_dir_entry *p;
1251 1251
1252 p = create_proc_entry("lec", S_IRUGO, atm_proc_root); 1252 p = proc_create("lec", S_IRUGO, atm_proc_root, &lec_seq_fops);
1253 if (p)
1254 p->proc_fops = &lec_seq_fops;
1255#endif 1253#endif
1256 1254
1257 register_atm_ioctl(&lane_ioctl_ops); 1255 register_atm_ioctl(&lane_ioctl_ops);
diff --git a/net/atm/mpoa_proc.c b/net/atm/mpoa_proc.c
index 91f3ffc90dbd..4990541ef5da 100644
--- a/net/atm/mpoa_proc.c
+++ b/net/atm/mpoa_proc.c
@@ -276,12 +276,11 @@ int mpc_proc_init(void)
276{ 276{
277 struct proc_dir_entry *p; 277 struct proc_dir_entry *p;
278 278
279 p = create_proc_entry(STAT_FILE_NAME, 0, atm_proc_root); 279 p = proc_create(STAT_FILE_NAME, 0, atm_proc_root, &mpc_file_operations);
280 if (!p) { 280 if (!p) {
281 printk(KERN_ERR "Unable to initialize /proc/atm/%s\n", STAT_FILE_NAME); 281 printk(KERN_ERR "Unable to initialize /proc/atm/%s\n", STAT_FILE_NAME);
282 return -ENOMEM; 282 return -ENOMEM;
283 } 283 }
284 p->proc_fops = &mpc_file_operations;
285 p->owner = THIS_MODULE; 284 p->owner = THIS_MODULE;
286 return 0; 285 return 0;
287} 286}
diff --git a/net/atm/proc.c b/net/atm/proc.c
index 49125110bb8b..e9693aed7ef8 100644
--- a/net/atm/proc.c
+++ b/net/atm/proc.c
@@ -435,11 +435,11 @@ int atm_proc_dev_register(struct atm_dev *dev)
435 goto err_out; 435 goto err_out;
436 sprintf(dev->proc_name,"%s:%d",dev->type, dev->number); 436 sprintf(dev->proc_name,"%s:%d",dev->type, dev->number);
437 437
438 dev->proc_entry = create_proc_entry(dev->proc_name, 0, atm_proc_root); 438 dev->proc_entry = proc_create(dev->proc_name, 0, atm_proc_root,
439 &proc_atm_dev_ops);
439 if (!dev->proc_entry) 440 if (!dev->proc_entry)
440 goto err_free_name; 441 goto err_free_name;
441 dev->proc_entry->data = dev; 442 dev->proc_entry->data = dev;
442 dev->proc_entry->proc_fops = &proc_atm_dev_ops;
443 dev->proc_entry->owner = THIS_MODULE; 443 dev->proc_entry->owner = THIS_MODULE;
444 return 0; 444 return 0;
445err_free_name: 445err_free_name:
@@ -492,10 +492,10 @@ int __init atm_proc_init(void)
492 for (e = atm_proc_ents; e->name; e++) { 492 for (e = atm_proc_ents; e->name; e++) {
493 struct proc_dir_entry *dirent; 493 struct proc_dir_entry *dirent;
494 494
495 dirent = create_proc_entry(e->name, S_IRUGO, atm_proc_root); 495 dirent = proc_create(e->name, S_IRUGO,
496 atm_proc_root, e->proc_fops);
496 if (!dirent) 497 if (!dirent)
497 goto err_out_remove; 498 goto err_out_remove;
498 dirent->proc_fops = e->proc_fops;
499 dirent->owner = THIS_MODULE; 499 dirent->owner = THIS_MODULE;
500 e->dirent = dirent; 500 e->dirent = dirent;
501 } 501 }
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 906cb1ada4c3..e7821ba7a9a0 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -266,20 +266,24 @@ static struct ip_tunnel * ipgre_tunnel_locate(struct ip_tunnel_parm *parms, int
266 if (!dev) 266 if (!dev)
267 return NULL; 267 return NULL;
268 268
269 if (strchr(name, '%')) {
270 if (dev_alloc_name(dev, name) < 0)
271 goto failed_free;
272 }
273
269 dev->init = ipgre_tunnel_init; 274 dev->init = ipgre_tunnel_init;
270 nt = netdev_priv(dev); 275 nt = netdev_priv(dev);
271 nt->parms = *parms; 276 nt->parms = *parms;
272 277
273 if (register_netdevice(dev) < 0) { 278 if (register_netdevice(dev) < 0)
274 free_netdev(dev); 279 goto failed_free;
275 goto failed;
276 }
277 280
278 dev_hold(dev); 281 dev_hold(dev);
279 ipgre_tunnel_link(nt); 282 ipgre_tunnel_link(nt);
280 return nt; 283 return nt;
281 284
282failed: 285failed_free:
286 free_netdev(dev);
283 return NULL; 287 return NULL;
284} 288}
285 289
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c
index ae1f45fc23b9..58b60b2fb011 100644
--- a/net/ipv4/ipcomp.c
+++ b/net/ipv4/ipcomp.c
@@ -108,8 +108,11 @@ static int ipcomp_compress(struct xfrm_state *x, struct sk_buff *skb)
108 const int cpu = get_cpu(); 108 const int cpu = get_cpu();
109 u8 *scratch = *per_cpu_ptr(ipcomp_scratches, cpu); 109 u8 *scratch = *per_cpu_ptr(ipcomp_scratches, cpu);
110 struct crypto_comp *tfm = *per_cpu_ptr(ipcd->tfms, cpu); 110 struct crypto_comp *tfm = *per_cpu_ptr(ipcd->tfms, cpu);
111 int err = crypto_comp_compress(tfm, start, plen, scratch, &dlen); 111 int err;
112 112
113 local_bh_disable();
114 err = crypto_comp_compress(tfm, start, plen, scratch, &dlen);
115 local_bh_enable();
113 if (err) 116 if (err)
114 goto out; 117 goto out;
115 118
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index e77e3b855834..dbaed69de06a 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -228,20 +228,24 @@ static struct ip_tunnel * ipip_tunnel_locate(struct ip_tunnel_parm *parms, int c
228 if (dev == NULL) 228 if (dev == NULL)
229 return NULL; 229 return NULL;
230 230
231 if (strchr(name, '%')) {
232 if (dev_alloc_name(dev, name) < 0)
233 goto failed_free;
234 }
235
231 nt = netdev_priv(dev); 236 nt = netdev_priv(dev);
232 dev->init = ipip_tunnel_init; 237 dev->init = ipip_tunnel_init;
233 nt->parms = *parms; 238 nt->parms = *parms;
234 239
235 if (register_netdevice(dev) < 0) { 240 if (register_netdevice(dev) < 0)
236 free_netdev(dev); 241 goto failed_free;
237 goto failed;
238 }
239 242
240 dev_hold(dev); 243 dev_hold(dev);
241 ipip_tunnel_link(nt); 244 ipip_tunnel_link(nt);
242 return nt; 245 return nt;
243 246
244failed: 247failed_free:
248 free_netdev(dev);
245 return NULL; 249 return NULL;
246} 250}
247 251
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 2a124e9a1b2d..78f438880923 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -238,17 +238,24 @@ static struct ip6_tnl *ip6_tnl_create(struct ip6_tnl_parm *p)
238 if (dev == NULL) 238 if (dev == NULL)
239 goto failed; 239 goto failed;
240 240
241 if (strchr(name, '%')) {
242 if (dev_alloc_name(dev, name) < 0)
243 goto failed_free;
244 }
245
241 t = netdev_priv(dev); 246 t = netdev_priv(dev);
242 dev->init = ip6_tnl_dev_init; 247 dev->init = ip6_tnl_dev_init;
243 t->parms = *p; 248 t->parms = *p;
244 249
245 if ((err = register_netdevice(dev)) < 0) { 250 if ((err = register_netdevice(dev)) < 0)
246 free_netdev(dev); 251 goto failed_free;
247 goto failed; 252
248 }
249 dev_hold(dev); 253 dev_hold(dev);
250 ip6_tnl_link(t); 254 ip6_tnl_link(t);
251 return t; 255 return t;
256
257failed_free:
258 free_netdev(dev);
252failed: 259failed:
253 return NULL; 260 return NULL;
254} 261}
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c
index b90039593a7f..e3dcfa2f436b 100644
--- a/net/ipv6/ipcomp6.c
+++ b/net/ipv6/ipcomp6.c
@@ -146,7 +146,9 @@ static int ipcomp6_output(struct xfrm_state *x, struct sk_buff *skb)
146 scratch = *per_cpu_ptr(ipcomp6_scratches, cpu); 146 scratch = *per_cpu_ptr(ipcomp6_scratches, cpu);
147 tfm = *per_cpu_ptr(ipcd->tfms, cpu); 147 tfm = *per_cpu_ptr(ipcd->tfms, cpu);
148 148
149 local_bh_disable();
149 err = crypto_comp_compress(tfm, start, plen, scratch, &dlen); 150 err = crypto_comp_compress(tfm, start, plen, scratch, &dlen);
151 local_bh_enable();
150 if (err || (dlen + sizeof(*ipch)) >= plen) { 152 if (err || (dlen + sizeof(*ipch)) >= plen) {
151 put_cpu(); 153 put_cpu();
152 goto out_ok; 154 goto out_ok;
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index dde7801abeff..1656c003b989 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -171,6 +171,11 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int
171 if (dev == NULL) 171 if (dev == NULL)
172 return NULL; 172 return NULL;
173 173
174 if (strchr(name, '%')) {
175 if (dev_alloc_name(dev, name) < 0)
176 goto failed_free;
177 }
178
174 nt = netdev_priv(dev); 179 nt = netdev_priv(dev);
175 dev->init = ipip6_tunnel_init; 180 dev->init = ipip6_tunnel_init;
176 nt->parms = *parms; 181 nt->parms = *parms;
@@ -178,16 +183,16 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int
178 if (parms->i_flags & SIT_ISATAP) 183 if (parms->i_flags & SIT_ISATAP)
179 dev->priv_flags |= IFF_ISATAP; 184 dev->priv_flags |= IFF_ISATAP;
180 185
181 if (register_netdevice(dev) < 0) { 186 if (register_netdevice(dev) < 0)
182 free_netdev(dev); 187 goto failed_free;
183 goto failed;
184 }
185 188
186 dev_hold(dev); 189 dev_hold(dev);
187 190
188 ipip6_tunnel_link(nt); 191 ipip6_tunnel_link(nt);
189 return nt; 192 return nt;
190 193
194failed_free:
195 free_netdev(dev);
191failed: 196failed:
192 return NULL; 197 return NULL;
193} 198}
diff --git a/net/ipv6/sysctl_net_ipv6.c b/net/ipv6/sysctl_net_ipv6.c
index 408691b777c2..d6d3e68086f8 100644
--- a/net/ipv6/sysctl_net_ipv6.c
+++ b/net/ipv6/sysctl_net_ipv6.c
@@ -102,9 +102,6 @@ static int ipv6_sysctl_net_init(struct net *net)
102 net->ipv6.sysctl.table = register_net_sysctl_table(net, net_ipv6_ctl_path, 102 net->ipv6.sysctl.table = register_net_sysctl_table(net, net_ipv6_ctl_path,
103 ipv6_table); 103 ipv6_table);
104 if (!net->ipv6.sysctl.table) 104 if (!net->ipv6.sysctl.table)
105 return -ENOMEM;
106
107 if (!net->ipv6.sysctl.table)
108 goto out_ipv6_icmp_table; 105 goto out_ipv6_icmp_table;
109 106
110 err = 0; 107 err = 0;
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index 2019b4f0528d..9aeed5320228 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -1116,9 +1116,10 @@ static void ieee80211_sta_process_addba_request(struct net_device *dev,
1116 /* prepare reordering buffer */ 1116 /* prepare reordering buffer */
1117 tid_agg_rx->reorder_buf = 1117 tid_agg_rx->reorder_buf =
1118 kmalloc(buf_size * sizeof(struct sk_buf *), GFP_ATOMIC); 1118 kmalloc(buf_size * sizeof(struct sk_buf *), GFP_ATOMIC);
1119 if ((!tid_agg_rx->reorder_buf) && net_ratelimit()) { 1119 if (!tid_agg_rx->reorder_buf) {
1120 printk(KERN_ERR "can not allocate reordering buffer " 1120 if (net_ratelimit())
1121 "to tid %d\n", tid); 1121 printk(KERN_ERR "can not allocate reordering buffer "
1122 "to tid %d\n", tid);
1122 goto end; 1123 goto end;
1123 } 1124 }
1124 memset(tid_agg_rx->reorder_buf, 0, 1125 memset(tid_agg_rx->reorder_buf, 0,
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index 327e847d2702..b77eb56a87e3 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -256,13 +256,19 @@ __nf_conntrack_find(const struct nf_conntrack_tuple *tuple)
256 struct hlist_node *n; 256 struct hlist_node *n;
257 unsigned int hash = hash_conntrack(tuple); 257 unsigned int hash = hash_conntrack(tuple);
258 258
259 /* Disable BHs the entire time since we normally need to disable them
260 * at least once for the stats anyway.
261 */
262 local_bh_disable();
259 hlist_for_each_entry_rcu(h, n, &nf_conntrack_hash[hash], hnode) { 263 hlist_for_each_entry_rcu(h, n, &nf_conntrack_hash[hash], hnode) {
260 if (nf_ct_tuple_equal(tuple, &h->tuple)) { 264 if (nf_ct_tuple_equal(tuple, &h->tuple)) {
261 NF_CT_STAT_INC(found); 265 NF_CT_STAT_INC(found);
266 local_bh_enable();
262 return h; 267 return h;
263 } 268 }
264 NF_CT_STAT_INC(searched); 269 NF_CT_STAT_INC(searched);
265 } 270 }
271 local_bh_enable();
266 272
267 return NULL; 273 return NULL;
268} 274}
@@ -400,17 +406,20 @@ nf_conntrack_tuple_taken(const struct nf_conntrack_tuple *tuple,
400 struct hlist_node *n; 406 struct hlist_node *n;
401 unsigned int hash = hash_conntrack(tuple); 407 unsigned int hash = hash_conntrack(tuple);
402 408
403 rcu_read_lock(); 409 /* Disable BHs the entire time since we need to disable them at
410 * least once for the stats anyway.
411 */
412 rcu_read_lock_bh();
404 hlist_for_each_entry_rcu(h, n, &nf_conntrack_hash[hash], hnode) { 413 hlist_for_each_entry_rcu(h, n, &nf_conntrack_hash[hash], hnode) {
405 if (nf_ct_tuplehash_to_ctrack(h) != ignored_conntrack && 414 if (nf_ct_tuplehash_to_ctrack(h) != ignored_conntrack &&
406 nf_ct_tuple_equal(tuple, &h->tuple)) { 415 nf_ct_tuple_equal(tuple, &h->tuple)) {
407 NF_CT_STAT_INC(found); 416 NF_CT_STAT_INC(found);
408 rcu_read_unlock(); 417 rcu_read_unlock_bh();
409 return 1; 418 return 1;
410 } 419 }
411 NF_CT_STAT_INC(searched); 420 NF_CT_STAT_INC(searched);
412 } 421 }
413 rcu_read_unlock(); 422 rcu_read_unlock_bh();
414 423
415 return 0; 424 return 0;
416} 425}
diff --git a/net/netfilter/xt_conntrack.c b/net/netfilter/xt_conntrack.c
index 85330856a29c..0c50b2894055 100644
--- a/net/netfilter/xt_conntrack.c
+++ b/net/netfilter/xt_conntrack.c
@@ -122,7 +122,7 @@ conntrack_addrcmp(const union nf_inet_addr *kaddr,
122 const union nf_inet_addr *umask, unsigned int l3proto) 122 const union nf_inet_addr *umask, unsigned int l3proto)
123{ 123{
124 if (l3proto == AF_INET) 124 if (l3proto == AF_INET)
125 return (kaddr->ip & umask->ip) == uaddr->ip; 125 return ((kaddr->ip ^ uaddr->ip) & umask->ip) == 0;
126 else if (l3proto == AF_INET6) 126 else if (l3proto == AF_INET6)
127 return ipv6_masked_addr_cmp(&kaddr->in6, &umask->in6, 127 return ipv6_masked_addr_cmp(&kaddr->in6, &umask->in6,
128 &uaddr->in6) == 0; 128 &uaddr->in6) == 0;
@@ -231,7 +231,7 @@ conntrack_mt(const struct sk_buff *skb, const struct net_device *in,
231 if (test_bit(IPS_DST_NAT_BIT, &ct->status)) 231 if (test_bit(IPS_DST_NAT_BIT, &ct->status))
232 statebit |= XT_CONNTRACK_STATE_DNAT; 232 statebit |= XT_CONNTRACK_STATE_DNAT;
233 } 233 }
234 if ((info->state_mask & statebit) ^ 234 if (!!(info->state_mask & statebit) ^
235 !(info->invert_flags & XT_CONNTRACK_STATE)) 235 !(info->invert_flags & XT_CONNTRACK_STATE))
236 return false; 236 return false;
237 } 237 }