aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/8021q/vlanproc.c11
-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/bluetooth/l2cap.c3
-rw-r--r--net/core/neighbour.c6
-rw-r--r--net/core/netpoll.c12
-rw-r--r--net/core/pktgen.c10
-rw-r--r--net/ipv4/Kconfig2
-rw-r--r--net/ipv4/devinet.c1
-rw-r--r--net/ipv4/ip_gre.c14
-rw-r--r--net/ipv4/ipcomp.c5
-rw-r--r--net/ipv4/ipconfig.c4
-rw-r--r--net/ipv4/ipip.c14
-rw-r--r--net/ipv4/route.c5
-rw-r--r--net/ipv4/tcp_bic.c5
-rw-r--r--net/ipv4/tcp_input.c14
-rw-r--r--net/ipv6/Kconfig2
-rw-r--r--net/ipv6/addrconf.c3
-rw-r--r--net/ipv6/ip6_tunnel.c15
-rw-r--r--net/ipv6/ipcomp6.c2
-rw-r--r--net/ipv6/proc.c4
-rw-r--r--net/ipv6/route.c2
-rw-r--r--net/ipv6/sit.c13
-rw-r--r--net/ipv6/sysctl_net_ipv6.c3
-rw-r--r--net/ipx/ipx_proc.c11
-rw-r--r--net/irda/ircomm/ircomm_core.c8
-rw-r--r--net/irda/irlan/irlan_common.c4
-rw-r--r--net/irda/irproc.c8
-rw-r--r--net/iucv/iucv.c2
-rw-r--r--net/key/af_key.c5
-rw-r--r--net/llc/llc_proc.c8
-rw-r--r--net/mac80211/ieee80211_sta.c7
-rw-r--r--net/mac80211/rc80211_pid_algo.c92
-rw-r--r--net/netfilter/nf_conntrack_core.c15
-rw-r--r--net/netfilter/xt_conntrack.c4
-rw-r--r--net/sctp/auth.c4
-rw-r--r--net/sctp/ipv6.c12
-rw-r--r--net/sctp/objcnt.c5
-rw-r--r--net/sctp/proc.c13
-rw-r--r--net/sctp/protocol.c12
-rw-r--r--net/sctp/socket.c18
-rw-r--r--net/sctp/ulpevent.c2
-rw-r--r--net/sunrpc/cache.c14
-rw-r--r--net/sunrpc/stats.c3
-rw-r--r--net/sunrpc/xprtrdma/transport.c6
-rw-r--r--net/tipc/cluster.c2
-rw-r--r--net/tipc/link.c2
-rw-r--r--net/tipc/ref.c2
-rw-r--r--net/tipc/zone.c2
-rw-r--r--net/wanrouter/wanproc.c10
-rw-r--r--net/x25/x25_proc.c10
55 files changed, 244 insertions, 225 deletions
diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c
index a0ec47925597..146cfb0e9882 100644
--- a/net/8021q/vlanproc.c
+++ b/net/8021q/vlanproc.c
@@ -161,11 +161,10 @@ int __init vlan_proc_init(void)
161 if (!proc_vlan_dir) 161 if (!proc_vlan_dir)
162 goto err; 162 goto err;
163 163
164 proc_vlan_conf = create_proc_entry(name_conf, S_IFREG|S_IRUSR|S_IWUSR, 164 proc_vlan_conf = proc_create(name_conf, S_IFREG|S_IRUSR|S_IWUSR,
165 proc_vlan_dir); 165 proc_vlan_dir, &vlan_fops);
166 if (!proc_vlan_conf) 166 if (!proc_vlan_conf)
167 goto err; 167 goto err;
168 proc_vlan_conf->proc_fops = &vlan_fops;
169 return 0; 168 return 0;
170 169
171err: 170err:
@@ -182,13 +181,11 @@ int vlan_proc_add_dev(struct net_device *vlandev)
182{ 181{
183 struct vlan_dev_info *dev_info = vlan_dev_info(vlandev); 182 struct vlan_dev_info *dev_info = vlan_dev_info(vlandev);
184 183
185 dev_info->dent = create_proc_entry(vlandev->name, 184 dev_info->dent = proc_create(vlandev->name, S_IFREG|S_IRUSR|S_IWUSR,
186 S_IFREG|S_IRUSR|S_IWUSR, 185 proc_vlan_dir, &vlandev_fops);
187 proc_vlan_dir);
188 if (!dev_info->dent) 186 if (!dev_info->dent)
189 return -ENOBUFS; 187 return -ENOBUFS;
190 188
191 dev_info->dent->proc_fops = &vlandev_fops;
192 dev_info->dent->data = vlandev; 189 dev_info->dent->data = vlandev;
193 return 0; 190 return 0;
194} 191}
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/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index a8811c0a0cea..34f8bf98bc05 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -417,6 +417,9 @@ static void l2cap_conn_del(struct hci_conn *hcon, int err)
417 l2cap_sock_kill(sk); 417 l2cap_sock_kill(sk);
418 } 418 }
419 419
420 if (conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_SENT)
421 del_timer_sync(&conn->info_timer);
422
420 hcon->l2cap_data = NULL; 423 hcon->l2cap_data = NULL;
421 kfree(conn); 424 kfree(conn);
422} 425}
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 2328acbd16cd..d9a02b2cc289 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -839,7 +839,7 @@ static void neigh_timer_handler(unsigned long arg)
839 struct sk_buff *skb = skb_peek(&neigh->arp_queue); 839 struct sk_buff *skb = skb_peek(&neigh->arp_queue);
840 /* keep skb alive even if arp_queue overflows */ 840 /* keep skb alive even if arp_queue overflows */
841 if (skb) 841 if (skb)
842 skb_get(skb); 842 skb = skb_copy(skb, GFP_ATOMIC);
843 write_unlock(&neigh->lock); 843 write_unlock(&neigh->lock);
844 neigh->ops->solicit(neigh, skb); 844 neigh->ops->solicit(neigh, skb);
845 atomic_inc(&neigh->probes); 845 atomic_inc(&neigh->probes);
@@ -1389,10 +1389,10 @@ void neigh_table_init_no_netlink(struct neigh_table *tbl)
1389 panic("cannot create neighbour cache statistics"); 1389 panic("cannot create neighbour cache statistics");
1390 1390
1391#ifdef CONFIG_PROC_FS 1391#ifdef CONFIG_PROC_FS
1392 tbl->pde = create_proc_entry(tbl->id, 0, init_net.proc_net_stat); 1392 tbl->pde = proc_create(tbl->id, 0, init_net.proc_net_stat,
1393 &neigh_stat_seq_fops);
1393 if (!tbl->pde) 1394 if (!tbl->pde)
1394 panic("cannot create neighbour proc dir entry"); 1395 panic("cannot create neighbour proc dir entry");
1395 tbl->pde->proc_fops = &neigh_stat_seq_fops;
1396 tbl->pde->data = tbl; 1396 tbl->pde->data = tbl;
1397#endif 1397#endif
1398 1398
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 6faa128a4c8e..4b7e756181c9 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -39,6 +39,8 @@ static struct sk_buff_head skb_pool;
39static atomic_t trapped; 39static atomic_t trapped;
40 40
41#define USEC_PER_POLL 50 41#define USEC_PER_POLL 50
42#define NETPOLL_RX_ENABLED 1
43#define NETPOLL_RX_DROP 2
42 44
43#define MAX_SKB_SIZE \ 45#define MAX_SKB_SIZE \
44 (MAX_UDP_CHUNK + sizeof(struct udphdr) + \ 46 (MAX_UDP_CHUNK + sizeof(struct udphdr) + \
@@ -126,11 +128,13 @@ static int poll_one_napi(struct netpoll_info *npinfo,
126 if (!test_bit(NAPI_STATE_SCHED, &napi->state)) 128 if (!test_bit(NAPI_STATE_SCHED, &napi->state))
127 return budget; 129 return budget;
128 130
131 npinfo->rx_flags |= NETPOLL_RX_DROP;
129 atomic_inc(&trapped); 132 atomic_inc(&trapped);
130 133
131 work = napi->poll(napi, budget); 134 work = napi->poll(napi, budget);
132 135
133 atomic_dec(&trapped); 136 atomic_dec(&trapped);
137 npinfo->rx_flags &= ~NETPOLL_RX_DROP;
134 138
135 return budget - work; 139 return budget - work;
136} 140}
@@ -472,7 +476,7 @@ int __netpoll_rx(struct sk_buff *skb)
472 if (skb->dev->type != ARPHRD_ETHER) 476 if (skb->dev->type != ARPHRD_ETHER)
473 goto out; 477 goto out;
474 478
475 /* if receive ARP during middle of NAPI poll, then queue */ 479 /* check if netpoll clients need ARP */
476 if (skb->protocol == htons(ETH_P_ARP) && 480 if (skb->protocol == htons(ETH_P_ARP) &&
477 atomic_read(&trapped)) { 481 atomic_read(&trapped)) {
478 skb_queue_tail(&npi->arp_tx, skb); 482 skb_queue_tail(&npi->arp_tx, skb);
@@ -534,9 +538,6 @@ int __netpoll_rx(struct sk_buff *skb)
534 return 1; 538 return 1;
535 539
536out: 540out:
537 /* If packet received while already in poll then just
538 * silently drop.
539 */
540 if (atomic_read(&trapped)) { 541 if (atomic_read(&trapped)) {
541 kfree_skb(skb); 542 kfree_skb(skb);
542 return 1; 543 return 1;
@@ -675,6 +676,7 @@ int netpoll_setup(struct netpoll *np)
675 goto release; 676 goto release;
676 } 677 }
677 678
679 npinfo->rx_flags = 0;
678 npinfo->rx_np = NULL; 680 npinfo->rx_np = NULL;
679 681
680 spin_lock_init(&npinfo->rx_lock); 682 spin_lock_init(&npinfo->rx_lock);
@@ -756,6 +758,7 @@ int netpoll_setup(struct netpoll *np)
756 758
757 if (np->rx_hook) { 759 if (np->rx_hook) {
758 spin_lock_irqsave(&npinfo->rx_lock, flags); 760 spin_lock_irqsave(&npinfo->rx_lock, flags);
761 npinfo->rx_flags |= NETPOLL_RX_ENABLED;
759 npinfo->rx_np = np; 762 npinfo->rx_np = np;
760 spin_unlock_irqrestore(&npinfo->rx_lock, flags); 763 spin_unlock_irqrestore(&npinfo->rx_lock, flags);
761 } 764 }
@@ -797,6 +800,7 @@ void netpoll_cleanup(struct netpoll *np)
797 if (npinfo->rx_np == np) { 800 if (npinfo->rx_np == np) {
798 spin_lock_irqsave(&npinfo->rx_lock, flags); 801 spin_lock_irqsave(&npinfo->rx_lock, flags);
799 npinfo->rx_np = NULL; 802 npinfo->rx_np = NULL;
803 npinfo->rx_flags &= ~NETPOLL_RX_ENABLED;
800 spin_unlock_irqrestore(&npinfo->rx_lock, flags); 804 spin_unlock_irqrestore(&npinfo->rx_lock, flags);
801 } 805 }
802 806
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index bfcdfaebca5c..20e63b302ba6 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -3570,14 +3570,14 @@ static int pktgen_add_device(struct pktgen_thread *t, const char *ifname)
3570 if (err) 3570 if (err)
3571 goto out1; 3571 goto out1;
3572 3572
3573 pkt_dev->entry = create_proc_entry(ifname, 0600, pg_proc_dir); 3573 pkt_dev->entry = proc_create(ifname, 0600,
3574 pg_proc_dir, &pktgen_if_fops);
3574 if (!pkt_dev->entry) { 3575 if (!pkt_dev->entry) {
3575 printk(KERN_ERR "pktgen: cannot create %s/%s procfs entry.\n", 3576 printk(KERN_ERR "pktgen: cannot create %s/%s procfs entry.\n",
3576 PG_PROC_DIR, ifname); 3577 PG_PROC_DIR, ifname);
3577 err = -EINVAL; 3578 err = -EINVAL;
3578 goto out2; 3579 goto out2;
3579 } 3580 }
3580 pkt_dev->entry->proc_fops = &pktgen_if_fops;
3581 pkt_dev->entry->data = pkt_dev; 3581 pkt_dev->entry->data = pkt_dev;
3582#ifdef CONFIG_XFRM 3582#ifdef CONFIG_XFRM
3583 pkt_dev->ipsmode = XFRM_MODE_TRANSPORT; 3583 pkt_dev->ipsmode = XFRM_MODE_TRANSPORT;
@@ -3628,7 +3628,7 @@ static int __init pktgen_create_thread(int cpu)
3628 kthread_bind(p, cpu); 3628 kthread_bind(p, cpu);
3629 t->tsk = p; 3629 t->tsk = p;
3630 3630
3631 pe = create_proc_entry(t->tsk->comm, 0600, pg_proc_dir); 3631 pe = proc_create(t->tsk->comm, 0600, pg_proc_dir, &pktgen_thread_fops);
3632 if (!pe) { 3632 if (!pe) {
3633 printk(KERN_ERR "pktgen: cannot create %s/%s procfs entry.\n", 3633 printk(KERN_ERR "pktgen: cannot create %s/%s procfs entry.\n",
3634 PG_PROC_DIR, t->tsk->comm); 3634 PG_PROC_DIR, t->tsk->comm);
@@ -3638,7 +3638,6 @@ static int __init pktgen_create_thread(int cpu)
3638 return -EINVAL; 3638 return -EINVAL;
3639 } 3639 }
3640 3640
3641 pe->proc_fops = &pktgen_thread_fops;
3642 pe->data = t; 3641 pe->data = t;
3643 3642
3644 wake_up_process(p); 3643 wake_up_process(p);
@@ -3709,7 +3708,7 @@ static int __init pg_init(void)
3709 return -ENODEV; 3708 return -ENODEV;
3710 pg_proc_dir->owner = THIS_MODULE; 3709 pg_proc_dir->owner = THIS_MODULE;
3711 3710
3712 pe = create_proc_entry(PGCTRL, 0600, pg_proc_dir); 3711 pe = proc_create(PGCTRL, 0600, pg_proc_dir, &pktgen_fops);
3713 if (pe == NULL) { 3712 if (pe == NULL) {
3714 printk(KERN_ERR "pktgen: ERROR: cannot create %s " 3713 printk(KERN_ERR "pktgen: ERROR: cannot create %s "
3715 "procfs entry.\n", PGCTRL); 3714 "procfs entry.\n", PGCTRL);
@@ -3717,7 +3716,6 @@ static int __init pg_init(void)
3717 return -EINVAL; 3716 return -EINVAL;
3718 } 3717 }
3719 3718
3720 pe->proc_fops = &pktgen_fops;
3721 pe->data = NULL; 3719 pe->data = NULL;
3722 3720
3723 /* Register us to receive netdevice events */ 3721 /* Register us to receive netdevice events */
diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig
index 19880b086e71..9c7e5ffb223d 100644
--- a/net/ipv4/Kconfig
+++ b/net/ipv4/Kconfig
@@ -343,7 +343,7 @@ config INET_ESP
343 tristate "IP: ESP transformation" 343 tristate "IP: ESP transformation"
344 select XFRM 344 select XFRM
345 select CRYPTO 345 select CRYPTO
346 select CRYPTO_AEAD 346 select CRYPTO_AUTHENC
347 select CRYPTO_HMAC 347 select CRYPTO_HMAC
348 select CRYPTO_MD5 348 select CRYPTO_MD5
349 select CRYPTO_CBC 349 select CRYPTO_CBC
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index f282b26f63eb..87490f7bb0f7 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -752,6 +752,7 @@ int devinet_ioctl(unsigned int cmd, void __user *arg)
752 inet_del_ifa(in_dev, ifap, 0); 752 inet_del_ifa(in_dev, ifap, 0);
753 ifa->ifa_broadcast = 0; 753 ifa->ifa_broadcast = 0;
754 ifa->ifa_anycast = 0; 754 ifa->ifa_anycast = 0;
755 ifa->ifa_scope = 0;
755 } 756 }
756 757
757 ifa->ifa_address = ifa->ifa_local = sin->sin_addr.s_addr; 758 ifa->ifa_address = ifa->ifa_local = sin->sin_addr.s_addr;
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/ipconfig.c b/net/ipv4/ipconfig.c
index 10013ccee8dd..5dd938579eeb 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -753,9 +753,9 @@ static void __init ic_bootp_send_if(struct ic_device *d, unsigned long jiffies_d
753 printk("Unknown ARP type 0x%04x for device %s\n", dev->type, dev->name); 753 printk("Unknown ARP type 0x%04x for device %s\n", dev->type, dev->name);
754 b->htype = dev->type; /* can cause undefined behavior */ 754 b->htype = dev->type; /* can cause undefined behavior */
755 } 755 }
756
757 /* server_ip and your_ip address are both already zero per RFC2131 */
756 b->hlen = dev->addr_len; 758 b->hlen = dev->addr_len;
757 b->your_ip = NONE;
758 b->server_ip = NONE;
759 memcpy(b->hw_addr, dev->dev_addr, dev->addr_len); 759 memcpy(b->hw_addr, dev->dev_addr, dev->addr_len);
760 b->secs = htons(jiffies_diff / HZ); 760 b->secs = htons(jiffies_diff / HZ);
761 b->xid = d->xid; 761 b->xid = d->xid;
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/ipv4/route.c b/net/ipv4/route.c
index 525787b52b72..7b5e8e1d94be 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -542,12 +542,11 @@ static __init int ip_rt_proc_init(struct net *net)
542 if (!pde) 542 if (!pde)
543 goto err1; 543 goto err1;
544 544
545 pde = create_proc_entry("rt_cache", S_IRUGO, net->proc_net_stat); 545 pde = proc_create("rt_cache", S_IRUGO,
546 net->proc_net_stat, &rt_cpu_seq_fops);
546 if (!pde) 547 if (!pde)
547 goto err2; 548 goto err2;
548 549
549 pde->proc_fops = &rt_cpu_seq_fops;
550
551#ifdef CONFIG_NET_CLS_ROUTE 550#ifdef CONFIG_NET_CLS_ROUTE
552 pde = create_proc_read_entry("rt_acct", 0, net->proc_net, 551 pde = create_proc_read_entry("rt_acct", 0, net->proc_net,
553 ip_rt_acct_read, NULL); 552 ip_rt_acct_read, NULL);
diff --git a/net/ipv4/tcp_bic.c b/net/ipv4/tcp_bic.c
index 5212ed9b0c98..7eb7636db0d0 100644
--- a/net/ipv4/tcp_bic.c
+++ b/net/ipv4/tcp_bic.c
@@ -1,12 +1,13 @@
1/* 1/*
2 * Binary Increase Congestion control for TCP 2 * Binary Increase Congestion control for TCP
3 * 3 * Home page:
4 * http://netsrv.csc.ncsu.edu/twiki/bin/view/Main/BIC
4 * This is from the implementation of BICTCP in 5 * This is from the implementation of BICTCP in
5 * Lison-Xu, Kahaled Harfoush, and Injong Rhee. 6 * Lison-Xu, Kahaled Harfoush, and Injong Rhee.
6 * "Binary Increase Congestion Control for Fast, Long Distance 7 * "Binary Increase Congestion Control for Fast, Long Distance
7 * Networks" in InfoComm 2004 8 * Networks" in InfoComm 2004
8 * Available from: 9 * Available from:
9 * http://www.csc.ncsu.edu/faculty/rhee/export/bitcp.pdf 10 * http://netsrv.csc.ncsu.edu/export/bitcp.pdf
10 * 11 *
11 * Unless BIC is enabled and congestion window is large 12 * Unless BIC is enabled and congestion window is large
12 * this behaves the same as the original Reno. 13 * this behaves the same as the original Reno.
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 19c449f62672..7facdb0f6960 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1367,7 +1367,7 @@ static struct sk_buff *tcp_sacktag_walk(struct sk_buff *skb, struct sock *sk,
1367 * a normal way 1367 * a normal way
1368 */ 1368 */
1369static struct sk_buff *tcp_sacktag_skip(struct sk_buff *skb, struct sock *sk, 1369static struct sk_buff *tcp_sacktag_skip(struct sk_buff *skb, struct sock *sk,
1370 u32 skip_to_seq) 1370 u32 skip_to_seq, int *fack_count)
1371{ 1371{
1372 tcp_for_write_queue_from(skb, sk) { 1372 tcp_for_write_queue_from(skb, sk) {
1373 if (skb == tcp_send_head(sk)) 1373 if (skb == tcp_send_head(sk))
@@ -1375,6 +1375,8 @@ static struct sk_buff *tcp_sacktag_skip(struct sk_buff *skb, struct sock *sk,
1375 1375
1376 if (!before(TCP_SKB_CB(skb)->end_seq, skip_to_seq)) 1376 if (!before(TCP_SKB_CB(skb)->end_seq, skip_to_seq))
1377 break; 1377 break;
1378
1379 *fack_count += tcp_skb_pcount(skb);
1378 } 1380 }
1379 return skb; 1381 return skb;
1380} 1382}
@@ -1390,7 +1392,7 @@ static struct sk_buff *tcp_maybe_skipping_dsack(struct sk_buff *skb,
1390 return skb; 1392 return skb;
1391 1393
1392 if (before(next_dup->start_seq, skip_to_seq)) { 1394 if (before(next_dup->start_seq, skip_to_seq)) {
1393 skb = tcp_sacktag_skip(skb, sk, next_dup->start_seq); 1395 skb = tcp_sacktag_skip(skb, sk, next_dup->start_seq, fack_count);
1394 tcp_sacktag_walk(skb, sk, NULL, 1396 tcp_sacktag_walk(skb, sk, NULL,
1395 next_dup->start_seq, next_dup->end_seq, 1397 next_dup->start_seq, next_dup->end_seq,
1396 1, fack_count, reord, flag); 1398 1, fack_count, reord, flag);
@@ -1537,7 +1539,8 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb,
1537 1539
1538 /* Head todo? */ 1540 /* Head todo? */
1539 if (before(start_seq, cache->start_seq)) { 1541 if (before(start_seq, cache->start_seq)) {
1540 skb = tcp_sacktag_skip(skb, sk, start_seq); 1542 skb = tcp_sacktag_skip(skb, sk, start_seq,
1543 &fack_count);
1541 skb = tcp_sacktag_walk(skb, sk, next_dup, 1544 skb = tcp_sacktag_walk(skb, sk, next_dup,
1542 start_seq, 1545 start_seq,
1543 cache->start_seq, 1546 cache->start_seq,
@@ -1565,7 +1568,8 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb,
1565 goto walk; 1568 goto walk;
1566 } 1569 }
1567 1570
1568 skb = tcp_sacktag_skip(skb, sk, cache->end_seq); 1571 skb = tcp_sacktag_skip(skb, sk, cache->end_seq,
1572 &fack_count);
1569 /* Check overlap against next cached too (past this one already) */ 1573 /* Check overlap against next cached too (past this one already) */
1570 cache++; 1574 cache++;
1571 continue; 1575 continue;
@@ -1577,7 +1581,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb,
1577 break; 1581 break;
1578 fack_count = tp->fackets_out; 1582 fack_count = tp->fackets_out;
1579 } 1583 }
1580 skb = tcp_sacktag_skip(skb, sk, start_seq); 1584 skb = tcp_sacktag_skip(skb, sk, start_seq, &fack_count);
1581 1585
1582walk: 1586walk:
1583 skb = tcp_sacktag_walk(skb, sk, next_dup, start_seq, end_seq, 1587 skb = tcp_sacktag_walk(skb, sk, next_dup, start_seq, end_seq,
diff --git a/net/ipv6/Kconfig b/net/ipv6/Kconfig
index 3ffb0323668c..58219dfffef8 100644
--- a/net/ipv6/Kconfig
+++ b/net/ipv6/Kconfig
@@ -85,7 +85,7 @@ config INET6_ESP
85 depends on IPV6 85 depends on IPV6
86 select XFRM 86 select XFRM
87 select CRYPTO 87 select CRYPTO
88 select CRYPTO_AEAD 88 select CRYPTO_AUTHENC
89 select CRYPTO_HMAC 89 select CRYPTO_HMAC
90 select CRYPTO_MD5 90 select CRYPTO_MD5
91 select CRYPTO_CBC 91 select CRYPTO_CBC
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index e40213db9e4c..101e0e70ba27 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1557,6 +1557,7 @@ addrconf_prefix_route(struct in6_addr *pfx, int plen, struct net_device *dev,
1557 .fc_expires = expires, 1557 .fc_expires = expires,
1558 .fc_dst_len = plen, 1558 .fc_dst_len = plen,
1559 .fc_flags = RTF_UP | flags, 1559 .fc_flags = RTF_UP | flags,
1560 .fc_nlinfo.nl_net = &init_net,
1560 }; 1561 };
1561 1562
1562 ipv6_addr_copy(&cfg.fc_dst, pfx); 1563 ipv6_addr_copy(&cfg.fc_dst, pfx);
@@ -1583,6 +1584,7 @@ static void addrconf_add_mroute(struct net_device *dev)
1583 .fc_ifindex = dev->ifindex, 1584 .fc_ifindex = dev->ifindex,
1584 .fc_dst_len = 8, 1585 .fc_dst_len = 8,
1585 .fc_flags = RTF_UP, 1586 .fc_flags = RTF_UP,
1587 .fc_nlinfo.nl_net = &init_net,
1586 }; 1588 };
1587 1589
1588 ipv6_addr_set(&cfg.fc_dst, htonl(0xFF000000), 0, 0, 0); 1590 ipv6_addr_set(&cfg.fc_dst, htonl(0xFF000000), 0, 0, 0);
@@ -1599,6 +1601,7 @@ static void sit_route_add(struct net_device *dev)
1599 .fc_ifindex = dev->ifindex, 1601 .fc_ifindex = dev->ifindex,
1600 .fc_dst_len = 96, 1602 .fc_dst_len = 96,
1601 .fc_flags = RTF_UP | RTF_NONEXTHOP, 1603 .fc_flags = RTF_UP | RTF_NONEXTHOP,
1604 .fc_nlinfo.nl_net = &init_net,
1602 }; 1605 };
1603 1606
1604 /* prefix length - 96 bits "::d.d.d.d" */ 1607 /* prefix length - 96 bits "::d.d.d.d" */
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/proc.c b/net/ipv6/proc.c
index 35e502a72495..199ef379e501 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -217,12 +217,12 @@ int snmp6_register_dev(struct inet6_dev *idev)
217 if (!proc_net_devsnmp6) 217 if (!proc_net_devsnmp6)
218 return -ENOENT; 218 return -ENOENT;
219 219
220 p = create_proc_entry(idev->dev->name, S_IRUGO, proc_net_devsnmp6); 220 p = proc_create(idev->dev->name, S_IRUGO,
221 proc_net_devsnmp6, &snmp6_seq_fops);
221 if (!p) 222 if (!p)
222 return -ENOMEM; 223 return -ENOMEM;
223 224
224 p->data = idev; 225 p->data = idev;
225 p->proc_fops = &snmp6_seq_fops;
226 226
227 idev->stats.proc_dir_entry = p; 227 idev->stats.proc_dir_entry = p;
228 return 0; 228 return 0;
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 6e7b56ef4449..e8b241cb60bc 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1719,6 +1719,8 @@ static void rtmsg_to_fib6_config(struct in6_rtmsg *rtmsg,
1719 cfg->fc_src_len = rtmsg->rtmsg_src_len; 1719 cfg->fc_src_len = rtmsg->rtmsg_src_len;
1720 cfg->fc_flags = rtmsg->rtmsg_flags; 1720 cfg->fc_flags = rtmsg->rtmsg_flags;
1721 1721
1722 cfg->fc_nlinfo.nl_net = &init_net;
1723
1722 ipv6_addr_copy(&cfg->fc_dst, &rtmsg->rtmsg_dst); 1724 ipv6_addr_copy(&cfg->fc_dst, &rtmsg->rtmsg_dst);
1723 ipv6_addr_copy(&cfg->fc_src, &rtmsg->rtmsg_src); 1725 ipv6_addr_copy(&cfg->fc_src, &rtmsg->rtmsg_src);
1724 ipv6_addr_copy(&cfg->fc_gateway, &rtmsg->rtmsg_gateway); 1726 ipv6_addr_copy(&cfg->fc_gateway, &rtmsg->rtmsg_gateway);
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/ipx/ipx_proc.c b/net/ipx/ipx_proc.c
index d483a00dc427..5ed97ad0e2e3 100644
--- a/net/ipx/ipx_proc.c
+++ b/net/ipx/ipx_proc.c
@@ -358,22 +358,19 @@ int __init ipx_proc_init(void)
358 358
359 if (!ipx_proc_dir) 359 if (!ipx_proc_dir)
360 goto out; 360 goto out;
361 p = create_proc_entry("interface", S_IRUGO, ipx_proc_dir); 361 p = proc_create("interface", S_IRUGO,
362 ipx_proc_dir, &ipx_seq_interface_fops);
362 if (!p) 363 if (!p)
363 goto out_interface; 364 goto out_interface;
364 365
365 p->proc_fops = &ipx_seq_interface_fops; 366 p = proc_create("route", S_IRUGO, ipx_proc_dir, &ipx_seq_route_fops);
366 p = create_proc_entry("route", S_IRUGO, ipx_proc_dir);
367 if (!p) 367 if (!p)
368 goto out_route; 368 goto out_route;
369 369
370 p->proc_fops = &ipx_seq_route_fops; 370 p = proc_create("socket", S_IRUGO, ipx_proc_dir, &ipx_seq_socket_fops);
371 p = create_proc_entry("socket", S_IRUGO, ipx_proc_dir);
372 if (!p) 371 if (!p)
373 goto out_socket; 372 goto out_socket;
374 373
375 p->proc_fops = &ipx_seq_socket_fops;
376
377 rc = 0; 374 rc = 0;
378out: 375out:
379 return rc; 376 return rc;
diff --git a/net/irda/ircomm/ircomm_core.c b/net/irda/ircomm/ircomm_core.c
index b825399fc160..6eef1f2a7553 100644
--- a/net/irda/ircomm/ircomm_core.c
+++ b/net/irda/ircomm/ircomm_core.c
@@ -76,9 +76,11 @@ static int __init ircomm_init(void)
76 76
77#ifdef CONFIG_PROC_FS 77#ifdef CONFIG_PROC_FS
78 { struct proc_dir_entry *ent; 78 { struct proc_dir_entry *ent;
79 ent = create_proc_entry("ircomm", 0, proc_irda); 79 ent = proc_create("ircomm", 0, proc_irda, &ircomm_proc_fops);
80 if (ent) 80 if (!ent) {
81 ent->proc_fops = &ircomm_proc_fops; 81 printk(KERN_ERR "ircomm_init: can't create /proc entry!\n");
82 return -ENODEV;
83 }
82 } 84 }
83#endif /* CONFIG_PROC_FS */ 85#endif /* CONFIG_PROC_FS */
84 86
diff --git a/net/irda/irlan/irlan_common.c b/net/irda/irlan/irlan_common.c
index a4b56e25a917..1eb4bbcb1c9e 100644
--- a/net/irda/irlan/irlan_common.c
+++ b/net/irda/irlan/irlan_common.c
@@ -128,13 +128,11 @@ static int __init irlan_init(void)
128 128
129#ifdef CONFIG_PROC_FS 129#ifdef CONFIG_PROC_FS
130 { struct proc_dir_entry *proc; 130 { struct proc_dir_entry *proc;
131 proc = create_proc_entry("irlan", 0, proc_irda); 131 proc = proc_create("irlan", 0, proc_irda, &irlan_fops);
132 if (!proc) { 132 if (!proc) {
133 printk(KERN_ERR "irlan_init: can't create /proc entry!\n"); 133 printk(KERN_ERR "irlan_init: can't create /proc entry!\n");
134 return -ENODEV; 134 return -ENODEV;
135 } 135 }
136
137 proc->proc_fops = &irlan_fops;
138 } 136 }
139#endif /* CONFIG_PROC_FS */ 137#endif /* CONFIG_PROC_FS */
140 138
diff --git a/net/irda/irproc.c b/net/irda/irproc.c
index cae24fbda966..88e80a312732 100644
--- a/net/irda/irproc.c
+++ b/net/irda/irproc.c
@@ -72,11 +72,9 @@ void __init irda_proc_register(void)
72 return; 72 return;
73 proc_irda->owner = THIS_MODULE; 73 proc_irda->owner = THIS_MODULE;
74 74
75 for (i=0; i<ARRAY_SIZE(irda_dirs); i++) { 75 for (i = 0; i < ARRAY_SIZE(irda_dirs); i++)
76 d = create_proc_entry(irda_dirs[i].name, 0, proc_irda); 76 d = proc_create(irda_dirs[i].name, 0, proc_irda,
77 if (d) 77 irda_dirs[i].fops);
78 d->proc_fops = irda_dirs[i].fops;
79 }
80} 78}
81 79
82/* 80/*
diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c
index 2753b0c448f3..d764f4c1b7e4 100644
--- a/net/iucv/iucv.c
+++ b/net/iucv/iucv.c
@@ -621,7 +621,6 @@ static int iucv_sever_pathid(u16 pathid, u8 userdata[16])
621 return iucv_call_b2f0(IUCV_SEVER, parm); 621 return iucv_call_b2f0(IUCV_SEVER, parm);
622} 622}
623 623
624#ifdef CONFIG_SMP
625/** 624/**
626 * __iucv_cleanup_queue 625 * __iucv_cleanup_queue
627 * @dummy: unused dummy argument 626 * @dummy: unused dummy argument
@@ -632,7 +631,6 @@ static int iucv_sever_pathid(u16 pathid, u8 userdata[16])
632static void __iucv_cleanup_queue(void *dummy) 631static void __iucv_cleanup_queue(void *dummy)
633{ 632{
634} 633}
635#endif
636 634
637/** 635/**
638 * iucv_cleanup_queue 636 * iucv_cleanup_queue
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 1c853927810a..8b5f486ac80f 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -3807,17 +3807,16 @@ static int pfkey_init_proc(void)
3807{ 3807{
3808 struct proc_dir_entry *e; 3808 struct proc_dir_entry *e;
3809 3809
3810 e = create_proc_entry("pfkey", 0, init_net.proc_net); 3810 e = proc_net_fops_create(&init_net, "pfkey", 0, &pfkey_proc_ops);
3811 if (e == NULL) 3811 if (e == NULL)
3812 return -ENOMEM; 3812 return -ENOMEM;
3813 3813
3814 e->proc_fops = &pfkey_proc_ops;
3815 return 0; 3814 return 0;
3816} 3815}
3817 3816
3818static void pfkey_exit_proc(void) 3817static void pfkey_exit_proc(void)
3819{ 3818{
3820 remove_proc_entry("net/pfkey", NULL); 3819 proc_net_remove(&init_net, "pfkey");
3821} 3820}
3822#else 3821#else
3823static inline int pfkey_init_proc(void) 3822static inline int pfkey_init_proc(void)
diff --git a/net/llc/llc_proc.c b/net/llc/llc_proc.c
index cb34bc0518e8..48212c0a961c 100644
--- a/net/llc/llc_proc.c
+++ b/net/llc/llc_proc.c
@@ -239,18 +239,14 @@ int __init llc_proc_init(void)
239 goto out; 239 goto out;
240 llc_proc_dir->owner = THIS_MODULE; 240 llc_proc_dir->owner = THIS_MODULE;
241 241
242 p = create_proc_entry("socket", S_IRUGO, llc_proc_dir); 242 p = proc_create("socket", S_IRUGO, llc_proc_dir, &llc_seq_socket_fops);
243 if (!p) 243 if (!p)
244 goto out_socket; 244 goto out_socket;
245 245
246 p->proc_fops = &llc_seq_socket_fops; 246 p = proc_create("core", S_IRUGO, llc_proc_dir, &llc_seq_core_fops);
247
248 p = create_proc_entry("core", S_IRUGO, llc_proc_dir);
249 if (!p) 247 if (!p)
250 goto out_core; 248 goto out_core;
251 249
252 p->proc_fops = &llc_seq_core_fops;
253
254 rc = 0; 250 rc = 0;
255out: 251out:
256 return rc; 252 return rc;
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/mac80211/rc80211_pid_algo.c b/net/mac80211/rc80211_pid_algo.c
index c339571632b2..3b77410588e7 100644
--- a/net/mac80211/rc80211_pid_algo.c
+++ b/net/mac80211/rc80211_pid_algo.c
@@ -2,7 +2,7 @@
2 * Copyright 2002-2005, Instant802 Networks, Inc. 2 * Copyright 2002-2005, Instant802 Networks, Inc.
3 * Copyright 2005, Devicescape Software, Inc. 3 * Copyright 2005, Devicescape Software, Inc.
4 * Copyright 2007, Mattias Nissler <mattias.nissler@gmx.de> 4 * Copyright 2007, Mattias Nissler <mattias.nissler@gmx.de>
5 * Copyright 2007, Stefano Brivio <stefano.brivio@polimi.it> 5 * Copyright 2007-2008, Stefano Brivio <stefano.brivio@polimi.it>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as 8 * it under the terms of the GNU General Public License version 2 as
@@ -63,72 +63,66 @@
63 * RC_PID_ARITH_SHIFT. 63 * RC_PID_ARITH_SHIFT.
64 */ 64 */
65 65
66 66/* Adjust the rate while ensuring that we won't switch to a lower rate if it
67/* Shift the adjustment so that we won't switch to a lower rate if it exhibited 67 * exhibited a worse failed frames behaviour and we'll choose the highest rate
68 * a worse failed frames behaviour and we'll choose the highest rate whose 68 * whose failed frames behaviour is not worse than the one of the original rate
69 * failed frames behaviour is not worse than the one of the original rate 69 * target. While at it, check that the new rate is valid. */
70 * target. While at it, check that the adjustment is within the ranges. Then,
71 * provide the new rate index. */
72static int rate_control_pid_shift_adjust(struct rc_pid_rateinfo *r,
73 int adj, int cur, int l)
74{
75 int i, j, k, tmp;
76
77 j = r[cur].rev_index;
78 i = j + adj;
79
80 if (i < 0)
81 return r[0].index;
82 if (i >= l - 1)
83 return r[l - 1].index;
84
85 tmp = i;
86
87 if (adj < 0) {
88 for (k = j; k >= i; k--)
89 if (r[k].diff <= r[j].diff)
90 tmp = k;
91 } else {
92 for (k = i + 1; k + i < l; k++)
93 if (r[k].diff <= r[i].diff)
94 tmp = k;
95 }
96
97 return r[tmp].index;
98}
99
100static void rate_control_pid_adjust_rate(struct ieee80211_local *local, 70static void rate_control_pid_adjust_rate(struct ieee80211_local *local,
101 struct sta_info *sta, int adj, 71 struct sta_info *sta, int adj,
102 struct rc_pid_rateinfo *rinfo) 72 struct rc_pid_rateinfo *rinfo)
103{ 73{
104 struct ieee80211_sub_if_data *sdata; 74 struct ieee80211_sub_if_data *sdata;
105 struct ieee80211_hw_mode *mode; 75 struct ieee80211_hw_mode *mode;
106 int newidx; 76 int cur_sorted, new_sorted, probe, tmp, n_bitrates;
107 int maxrate; 77 int cur = sta->txrate;
108 int back = (adj > 0) ? 1 : -1;
109 78
110 sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev); 79 sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev);
111 80
112 mode = local->oper_hw_mode; 81 mode = local->oper_hw_mode;
113 maxrate = sdata->bss ? sdata->bss->max_ratectrl_rateidx : -1; 82 n_bitrates = mode->num_rates;
114 83
115 newidx = rate_control_pid_shift_adjust(rinfo, adj, sta->txrate, 84 /* Map passed arguments to sorted values. */
116 mode->num_rates); 85 cur_sorted = rinfo[cur].rev_index;
86 new_sorted = cur_sorted + adj;
117 87
118 while (newidx != sta->txrate) { 88 /* Check limits. */
119 if (rate_supported(sta, mode, newidx) && 89 if (new_sorted < 0)
120 (maxrate < 0 || newidx <= maxrate)) { 90 new_sorted = rinfo[0].rev_index;
121 sta->txrate = newidx; 91 else if (new_sorted >= n_bitrates)
122 break; 92 new_sorted = rinfo[n_bitrates - 1].rev_index;
123 }
124 93
125 newidx += back; 94 tmp = new_sorted;
95
96 if (adj < 0) {
97 /* Ensure that the rate decrease isn't disadvantageous. */
98 for (probe = cur_sorted; probe >= new_sorted; probe--)
99 if (rinfo[probe].diff <= rinfo[cur_sorted].diff &&
100 rate_supported(sta, mode, rinfo[probe].index))
101 tmp = probe;
102 } else {
103 /* Look for rate increase with zero (or below) cost. */
104 for (probe = new_sorted + 1; probe < n_bitrates; probe++)
105 if (rinfo[probe].diff <= rinfo[new_sorted].diff &&
106 rate_supported(sta, mode, rinfo[probe].index))
107 tmp = probe;
126 } 108 }
127 109
110 /* Fit the rate found to the nearest supported rate. */
111 do {
112 if (rate_supported(sta, mode, rinfo[tmp].index)) {
113 sta->txrate = rinfo[tmp].index;
114 break;
115 }
116 if (adj < 0)
117 tmp--;
118 else
119 tmp++;
120 } while (tmp < n_bitrates && tmp >= 0);
121
128#ifdef CONFIG_MAC80211_DEBUGFS 122#ifdef CONFIG_MAC80211_DEBUGFS
129 rate_control_pid_event_rate_change( 123 rate_control_pid_event_rate_change(
130 &((struct rc_pid_sta_info *)sta->rate_ctrl_priv)->events, 124 &((struct rc_pid_sta_info *)sta->rate_ctrl_priv)->events,
131 newidx, mode->rates[newidx].rate); 125 cur, mode->rates[cur].rate);
132#endif 126#endif
133} 127}
134 128
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 }
diff --git a/net/sctp/auth.c b/net/sctp/auth.c
index 8bb79f281774..675a5c3e68a6 100644
--- a/net/sctp/auth.c
+++ b/net/sctp/auth.c
@@ -838,11 +838,11 @@ int sctp_auth_set_key(struct sctp_endpoint *ep,
838 } 838 }
839 839
840 /* Create a new key data based on the info passed in */ 840 /* Create a new key data based on the info passed in */
841 key = sctp_auth_create_key(auth_key->sca_keylen, GFP_KERNEL); 841 key = sctp_auth_create_key(auth_key->sca_keylength, GFP_KERNEL);
842 if (!key) 842 if (!key)
843 goto nomem; 843 goto nomem;
844 844
845 memcpy(key->data, &auth_key->sca_key[0], auth_key->sca_keylen); 845 memcpy(key->data, &auth_key->sca_key[0], auth_key->sca_keylength);
846 846
847 /* If we are replacing, remove the old keys data from the 847 /* If we are replacing, remove the old keys data from the
848 * key id. If we are adding new key id, add it to the 848 * key id. If we are adding new key id, add it to the
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index 4d7ec961ae1d..87f940587d5f 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -966,7 +966,7 @@ static struct inet6_protocol sctpv6_protocol = {
966 .flags = INET6_PROTO_NOPOLICY | INET6_PROTO_FINAL, 966 .flags = INET6_PROTO_NOPOLICY | INET6_PROTO_FINAL,
967}; 967};
968 968
969static struct sctp_af sctp_ipv6_specific = { 969static struct sctp_af sctp_af_inet6 = {
970 .sa_family = AF_INET6, 970 .sa_family = AF_INET6,
971 .sctp_xmit = sctp_v6_xmit, 971 .sctp_xmit = sctp_v6_xmit,
972 .setsockopt = ipv6_setsockopt, 972 .setsockopt = ipv6_setsockopt,
@@ -998,7 +998,7 @@ static struct sctp_af sctp_ipv6_specific = {
998#endif 998#endif
999}; 999};
1000 1000
1001static struct sctp_pf sctp_pf_inet6_specific = { 1001static struct sctp_pf sctp_pf_inet6 = {
1002 .event_msgname = sctp_inet6_event_msgname, 1002 .event_msgname = sctp_inet6_event_msgname,
1003 .skb_msgname = sctp_inet6_skb_msgname, 1003 .skb_msgname = sctp_inet6_skb_msgname,
1004 .af_supported = sctp_inet6_af_supported, 1004 .af_supported = sctp_inet6_af_supported,
@@ -1008,7 +1008,7 @@ static struct sctp_pf sctp_pf_inet6_specific = {
1008 .supported_addrs = sctp_inet6_supported_addrs, 1008 .supported_addrs = sctp_inet6_supported_addrs,
1009 .create_accept_sk = sctp_v6_create_accept_sk, 1009 .create_accept_sk = sctp_v6_create_accept_sk,
1010 .addr_v4map = sctp_v6_addr_v4map, 1010 .addr_v4map = sctp_v6_addr_v4map,
1011 .af = &sctp_ipv6_specific, 1011 .af = &sctp_af_inet6,
1012}; 1012};
1013 1013
1014/* Initialize IPv6 support and register with socket layer. */ 1014/* Initialize IPv6 support and register with socket layer. */
@@ -1017,10 +1017,10 @@ int sctp_v6_init(void)
1017 int rc; 1017 int rc;
1018 1018
1019 /* Register the SCTP specific PF_INET6 functions. */ 1019 /* Register the SCTP specific PF_INET6 functions. */
1020 sctp_register_pf(&sctp_pf_inet6_specific, PF_INET6); 1020 sctp_register_pf(&sctp_pf_inet6, PF_INET6);
1021 1021
1022 /* Register the SCTP specific AF_INET6 functions. */ 1022 /* Register the SCTP specific AF_INET6 functions. */
1023 sctp_register_af(&sctp_ipv6_specific); 1023 sctp_register_af(&sctp_af_inet6);
1024 1024
1025 rc = proto_register(&sctpv6_prot, 1); 1025 rc = proto_register(&sctpv6_prot, 1);
1026 if (rc) 1026 if (rc)
@@ -1051,7 +1051,7 @@ void sctp_v6_exit(void)
1051 inet6_unregister_protosw(&sctpv6_seqpacket_protosw); 1051 inet6_unregister_protosw(&sctpv6_seqpacket_protosw);
1052 inet6_unregister_protosw(&sctpv6_stream_protosw); 1052 inet6_unregister_protosw(&sctpv6_stream_protosw);
1053 proto_unregister(&sctpv6_prot); 1053 proto_unregister(&sctpv6_prot);
1054 list_del(&sctp_ipv6_specific.list); 1054 list_del(&sctp_af_inet6.list);
1055} 1055}
1056 1056
1057/* Unregister with inet6 layer. */ 1057/* Unregister with inet6 layer. */
diff --git a/net/sctp/objcnt.c b/net/sctp/objcnt.c
index 14e294e37626..cfeb07ea1b04 100644
--- a/net/sctp/objcnt.c
+++ b/net/sctp/objcnt.c
@@ -132,12 +132,11 @@ void sctp_dbg_objcnt_init(void)
132{ 132{
133 struct proc_dir_entry *ent; 133 struct proc_dir_entry *ent;
134 134
135 ent = create_proc_entry("sctp_dbg_objcnt", 0, proc_net_sctp); 135 ent = proc_create("sctp_dbg_objcnt", 0,
136 proc_net_sctp, &sctp_objcnt_ops);
136 if (!ent) 137 if (!ent)
137 printk(KERN_WARNING 138 printk(KERN_WARNING
138 "sctp_dbg_objcnt: Unable to create /proc entry.\n"); 139 "sctp_dbg_objcnt: Unable to create /proc entry.\n");
139 else
140 ent->proc_fops = &sctp_objcnt_ops;
141} 140}
142 141
143/* Cleanup the objcount entry in the proc filesystem. */ 142/* Cleanup the objcount entry in the proc filesystem. */
diff --git a/net/sctp/proc.c b/net/sctp/proc.c
index 69bb5a63fd8b..973f1dbc2ec3 100644
--- a/net/sctp/proc.c
+++ b/net/sctp/proc.c
@@ -108,12 +108,10 @@ int __init sctp_snmp_proc_init(void)
108{ 108{
109 struct proc_dir_entry *p; 109 struct proc_dir_entry *p;
110 110
111 p = create_proc_entry("snmp", S_IRUGO, proc_net_sctp); 111 p = proc_create("snmp", S_IRUGO, proc_net_sctp, &sctp_snmp_seq_fops);
112 if (!p) 112 if (!p)
113 return -ENOMEM; 113 return -ENOMEM;
114 114
115 p->proc_fops = &sctp_snmp_seq_fops;
116
117 return 0; 115 return 0;
118} 116}
119 117
@@ -258,12 +256,10 @@ int __init sctp_eps_proc_init(void)
258{ 256{
259 struct proc_dir_entry *p; 257 struct proc_dir_entry *p;
260 258
261 p = create_proc_entry("eps", S_IRUGO, proc_net_sctp); 259 p = proc_create("eps", S_IRUGO, proc_net_sctp, &sctp_eps_seq_fops);
262 if (!p) 260 if (!p)
263 return -ENOMEM; 261 return -ENOMEM;
264 262
265 p->proc_fops = &sctp_eps_seq_fops;
266
267 return 0; 263 return 0;
268} 264}
269 265
@@ -369,12 +365,11 @@ int __init sctp_assocs_proc_init(void)
369{ 365{
370 struct proc_dir_entry *p; 366 struct proc_dir_entry *p;
371 367
372 p = create_proc_entry("assocs", S_IRUGO, proc_net_sctp); 368 p = proc_create("assocs", S_IRUGO, proc_net_sctp,
369 &sctp_assocs_seq_fops);
373 if (!p) 370 if (!p)
374 return -ENOMEM; 371 return -ENOMEM;
375 372
376 p->proc_fops = &sctp_assocs_seq_fops;
377
378 return 0; 373 return 0;
379} 374}
380 375
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 22a16571499c..688546dccd82 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -832,7 +832,7 @@ static inline int sctp_v4_xmit(struct sk_buff *skb,
832 return ip_queue_xmit(skb, ipfragok); 832 return ip_queue_xmit(skb, ipfragok);
833} 833}
834 834
835static struct sctp_af sctp_ipv4_specific; 835static struct sctp_af sctp_af_inet;
836 836
837static struct sctp_pf sctp_pf_inet = { 837static struct sctp_pf sctp_pf_inet = {
838 .event_msgname = sctp_inet_event_msgname, 838 .event_msgname = sctp_inet_event_msgname,
@@ -844,7 +844,7 @@ static struct sctp_pf sctp_pf_inet = {
844 .supported_addrs = sctp_inet_supported_addrs, 844 .supported_addrs = sctp_inet_supported_addrs,
845 .create_accept_sk = sctp_v4_create_accept_sk, 845 .create_accept_sk = sctp_v4_create_accept_sk,
846 .addr_v4map = sctp_v4_addr_v4map, 846 .addr_v4map = sctp_v4_addr_v4map,
847 .af = &sctp_ipv4_specific, 847 .af = &sctp_af_inet
848}; 848};
849 849
850/* Notifier for inetaddr addition/deletion events. */ 850/* Notifier for inetaddr addition/deletion events. */
@@ -906,7 +906,7 @@ static struct net_protocol sctp_protocol = {
906}; 906};
907 907
908/* IPv4 address related functions. */ 908/* IPv4 address related functions. */
909static struct sctp_af sctp_ipv4_specific = { 909static struct sctp_af sctp_af_inet = {
910 .sa_family = AF_INET, 910 .sa_family = AF_INET,
911 .sctp_xmit = sctp_v4_xmit, 911 .sctp_xmit = sctp_v4_xmit,
912 .setsockopt = ip_setsockopt, 912 .setsockopt = ip_setsockopt,
@@ -1192,7 +1192,7 @@ SCTP_STATIC __init int sctp_init(void)
1192 sctp_sysctl_register(); 1192 sctp_sysctl_register();
1193 1193
1194 INIT_LIST_HEAD(&sctp_address_families); 1194 INIT_LIST_HEAD(&sctp_address_families);
1195 sctp_register_af(&sctp_ipv4_specific); 1195 sctp_register_af(&sctp_af_inet);
1196 1196
1197 status = proto_register(&sctp_prot, 1); 1197 status = proto_register(&sctp_prot, 1);
1198 if (status) 1198 if (status)
@@ -1249,7 +1249,7 @@ err_v6_init:
1249 proto_unregister(&sctp_prot); 1249 proto_unregister(&sctp_prot);
1250err_proto_register: 1250err_proto_register:
1251 sctp_sysctl_unregister(); 1251 sctp_sysctl_unregister();
1252 list_del(&sctp_ipv4_specific.list); 1252 list_del(&sctp_af_inet.list);
1253 free_pages((unsigned long)sctp_port_hashtable, 1253 free_pages((unsigned long)sctp_port_hashtable,
1254 get_order(sctp_port_hashsize * 1254 get_order(sctp_port_hashsize *
1255 sizeof(struct sctp_bind_hashbucket))); 1255 sizeof(struct sctp_bind_hashbucket)));
@@ -1299,7 +1299,7 @@ SCTP_STATIC __exit void sctp_exit(void)
1299 inet_unregister_protosw(&sctp_seqpacket_protosw); 1299 inet_unregister_protosw(&sctp_seqpacket_protosw);
1300 1300
1301 sctp_sysctl_unregister(); 1301 sctp_sysctl_unregister();
1302 list_del(&sctp_ipv4_specific.list); 1302 list_del(&sctp_af_inet.list);
1303 1303
1304 free_pages((unsigned long)sctp_assoc_hashtable, 1304 free_pages((unsigned long)sctp_assoc_hashtable,
1305 get_order(sctp_assoc_hashsize * 1305 get_order(sctp_assoc_hashsize *
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 44797ad88a05..939892691a26 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -1964,7 +1964,7 @@ static int sctp_setsockopt_disable_fragments(struct sock *sk,
1964static int sctp_setsockopt_events(struct sock *sk, char __user *optval, 1964static int sctp_setsockopt_events(struct sock *sk, char __user *optval,
1965 int optlen) 1965 int optlen)
1966{ 1966{
1967 if (optlen != sizeof(struct sctp_event_subscribe)) 1967 if (optlen > sizeof(struct sctp_event_subscribe))
1968 return -EINVAL; 1968 return -EINVAL;
1969 if (copy_from_user(&sctp_sk(sk)->subscribe, optval, optlen)) 1969 if (copy_from_user(&sctp_sk(sk)->subscribe, optval, optlen))
1970 return -EFAULT; 1970 return -EFAULT;
@@ -5070,6 +5070,7 @@ static int sctp_getsockopt_peer_auth_chunks(struct sock *sk, int len,
5070 struct sctp_authchunks val; 5070 struct sctp_authchunks val;
5071 struct sctp_association *asoc; 5071 struct sctp_association *asoc;
5072 struct sctp_chunks_param *ch; 5072 struct sctp_chunks_param *ch;
5073 u32 num_chunks;
5073 char __user *to; 5074 char __user *to;
5074 5075
5075 if (len <= sizeof(struct sctp_authchunks)) 5076 if (len <= sizeof(struct sctp_authchunks))
@@ -5086,12 +5087,15 @@ static int sctp_getsockopt_peer_auth_chunks(struct sock *sk, int len,
5086 ch = asoc->peer.peer_chunks; 5087 ch = asoc->peer.peer_chunks;
5087 5088
5088 /* See if the user provided enough room for all the data */ 5089 /* See if the user provided enough room for all the data */
5089 if (len < ntohs(ch->param_hdr.length)) 5090 num_chunks = ntohs(ch->param_hdr.length) - sizeof(sctp_paramhdr_t);
5091 if (len < num_chunks)
5090 return -EINVAL; 5092 return -EINVAL;
5091 5093
5092 len = ntohs(ch->param_hdr.length); 5094 len = num_chunks;
5093 if (put_user(len, optlen)) 5095 if (put_user(len, optlen))
5094 return -EFAULT; 5096 return -EFAULT;
5097 if (put_user(num_chunks, &p->gauth_number_of_chunks))
5098 return -EFAULT;
5095 if (copy_to_user(to, ch->chunks, len)) 5099 if (copy_to_user(to, ch->chunks, len))
5096 return -EFAULT; 5100 return -EFAULT;
5097 5101
@@ -5105,6 +5109,7 @@ static int sctp_getsockopt_local_auth_chunks(struct sock *sk, int len,
5105 struct sctp_authchunks val; 5109 struct sctp_authchunks val;
5106 struct sctp_association *asoc; 5110 struct sctp_association *asoc;
5107 struct sctp_chunks_param *ch; 5111 struct sctp_chunks_param *ch;
5112 u32 num_chunks;
5108 char __user *to; 5113 char __user *to;
5109 5114
5110 if (len <= sizeof(struct sctp_authchunks)) 5115 if (len <= sizeof(struct sctp_authchunks))
@@ -5123,12 +5128,15 @@ static int sctp_getsockopt_local_auth_chunks(struct sock *sk, int len,
5123 else 5128 else
5124 ch = sctp_sk(sk)->ep->auth_chunk_list; 5129 ch = sctp_sk(sk)->ep->auth_chunk_list;
5125 5130
5126 if (len < ntohs(ch->param_hdr.length)) 5131 num_chunks = ntohs(ch->param_hdr.length) - sizeof(sctp_paramhdr_t);
5132 if (len < num_chunks)
5127 return -EINVAL; 5133 return -EINVAL;
5128 5134
5129 len = ntohs(ch->param_hdr.length); 5135 len = num_chunks;
5130 if (put_user(len, optlen)) 5136 if (put_user(len, optlen))
5131 return -EFAULT; 5137 return -EFAULT;
5138 if (put_user(num_chunks, &p->gauth_number_of_chunks))
5139 return -EFAULT;
5132 if (copy_to_user(to, ch->chunks, len)) 5140 if (copy_to_user(to, ch->chunks, len))
5133 return -EFAULT; 5141 return -EFAULT;
5134 5142
diff --git a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c
index e27b11f18b7f..b43f1f110f87 100644
--- a/net/sctp/ulpevent.c
+++ b/net/sctp/ulpevent.c
@@ -206,7 +206,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_assoc_change(
206 * This field is the total length of the notification data, including 206 * This field is the total length of the notification data, including
207 * the notification header. 207 * the notification header.
208 */ 208 */
209 sac->sac_length = sizeof(struct sctp_assoc_change); 209 sac->sac_length = skb->len;
210 210
211 /* Socket Extensions for SCTP 211 /* Socket Extensions for SCTP
212 * 5.3.1.1 SCTP_ASSOC_CHANGE 212 * 5.3.1.1 SCTP_ASSOC_CHANGE
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index 636c8e04e0be..b5f2786251b9 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -316,31 +316,29 @@ static int create_cache_proc_entries(struct cache_detail *cd)
316 cd->proc_ent->owner = cd->owner; 316 cd->proc_ent->owner = cd->owner;
317 cd->channel_ent = cd->content_ent = NULL; 317 cd->channel_ent = cd->content_ent = NULL;
318 318
319 p = create_proc_entry("flush", S_IFREG|S_IRUSR|S_IWUSR, cd->proc_ent); 319 p = proc_create("flush", S_IFREG|S_IRUSR|S_IWUSR,
320 cd->proc_ent, &cache_flush_operations);
320 cd->flush_ent = p; 321 cd->flush_ent = p;
321 if (p == NULL) 322 if (p == NULL)
322 goto out_nomem; 323 goto out_nomem;
323 p->proc_fops = &cache_flush_operations;
324 p->owner = cd->owner; 324 p->owner = cd->owner;
325 p->data = cd; 325 p->data = cd;
326 326
327 if (cd->cache_request || cd->cache_parse) { 327 if (cd->cache_request || cd->cache_parse) {
328 p = create_proc_entry("channel", S_IFREG|S_IRUSR|S_IWUSR, 328 p = proc_create("channel", S_IFREG|S_IRUSR|S_IWUSR,
329 cd->proc_ent); 329 cd->proc_ent, &cache_file_operations);
330 cd->channel_ent = p; 330 cd->channel_ent = p;
331 if (p == NULL) 331 if (p == NULL)
332 goto out_nomem; 332 goto out_nomem;
333 p->proc_fops = &cache_file_operations;
334 p->owner = cd->owner; 333 p->owner = cd->owner;
335 p->data = cd; 334 p->data = cd;
336 } 335 }
337 if (cd->cache_show) { 336 if (cd->cache_show) {
338 p = create_proc_entry("content", S_IFREG|S_IRUSR|S_IWUSR, 337 p = proc_create("content", S_IFREG|S_IRUSR|S_IWUSR,
339 cd->proc_ent); 338 cd->proc_ent, &content_file_operations);
340 cd->content_ent = p; 339 cd->content_ent = p;
341 if (p == NULL) 340 if (p == NULL)
342 goto out_nomem; 341 goto out_nomem;
343 p->proc_fops = &content_file_operations;
344 p->owner = cd->owner; 342 p->owner = cd->owner;
345 p->data = cd; 343 p->data = cd;
346 } 344 }
diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c
index 5a16875f5ac8..c6061a4346c8 100644
--- a/net/sunrpc/stats.c
+++ b/net/sunrpc/stats.c
@@ -229,9 +229,8 @@ do_register(const char *name, void *data, const struct file_operations *fops)
229 rpc_proc_init(); 229 rpc_proc_init();
230 dprintk("RPC: registering /proc/net/rpc/%s\n", name); 230 dprintk("RPC: registering /proc/net/rpc/%s\n", name);
231 231
232 ent = create_proc_entry(name, 0, proc_net_rpc); 232 ent = proc_create(name, 0, proc_net_rpc, fops);
233 if (ent) { 233 if (ent) {
234 ent->proc_fops = fops;
235 ent->data = data; 234 ent->data = data;
236 } 235 }
237 return ent; 236 return ent;
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
index 02c522c17de5..a564c1a39ec5 100644
--- a/net/sunrpc/xprtrdma/transport.c
+++ b/net/sunrpc/xprtrdma/transport.c
@@ -614,7 +614,11 @@ xprt_rdma_free(void *buffer)
614 return; 614 return;
615 615
616 req = container_of(buffer, struct rpcrdma_req, rl_xdr_buf[0]); 616 req = container_of(buffer, struct rpcrdma_req, rl_xdr_buf[0]);
617 r_xprt = container_of(req->rl_buffer, struct rpcrdma_xprt, rx_buf); 617 if (req->rl_iov.length == 0) { /* see allocate above */
618 r_xprt = container_of(((struct rpcrdma_req *) req->rl_buffer)->rl_buffer,
619 struct rpcrdma_xprt, rx_buf);
620 } else
621 r_xprt = container_of(req->rl_buffer, struct rpcrdma_xprt, rx_buf);
618 rep = req->rl_reply; 622 rep = req->rl_reply;
619 623
620 dprintk("RPC: %s: called on 0x%p%s\n", 624 dprintk("RPC: %s: called on 0x%p%s\n",
diff --git a/net/tipc/cluster.c b/net/tipc/cluster.c
index 95b373913aa0..4bb3404f610b 100644
--- a/net/tipc/cluster.c
+++ b/net/tipc/cluster.c
@@ -142,7 +142,7 @@ void tipc_cltr_attach_node(struct cluster *c_ptr, struct node *n_ptr)
142 max_n_num = tipc_highest_allowed_slave; 142 max_n_num = tipc_highest_allowed_slave;
143 assert(n_num > 0); 143 assert(n_num > 0);
144 assert(n_num <= max_n_num); 144 assert(n_num <= max_n_num);
145 assert(c_ptr->nodes[n_num] == 0); 145 assert(c_ptr->nodes[n_num] == NULL);
146 c_ptr->nodes[n_num] = n_ptr; 146 c_ptr->nodes[n_num] = n_ptr;
147 if (n_num > c_ptr->highest_node) 147 if (n_num > c_ptr->highest_node)
148 c_ptr->highest_node = n_num; 148 c_ptr->highest_node = n_num;
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 1b17fecee747..cefa99824c58 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -3251,7 +3251,7 @@ static void link_print(struct link *l_ptr, struct print_buf *buf,
3251 if ((mod(msg_seqno(buf_msg(l_ptr->last_out)) - 3251 if ((mod(msg_seqno(buf_msg(l_ptr->last_out)) -
3252 msg_seqno(buf_msg(l_ptr->first_out))) 3252 msg_seqno(buf_msg(l_ptr->first_out)))
3253 != (l_ptr->out_queue_size - 1)) 3253 != (l_ptr->out_queue_size - 1))
3254 || (l_ptr->last_out->next != 0)) { 3254 || (l_ptr->last_out->next != NULL)) {
3255 tipc_printf(buf, "\nSend queue inconsistency\n"); 3255 tipc_printf(buf, "\nSend queue inconsistency\n");
3256 tipc_printf(buf, "first_out= %x ", l_ptr->first_out); 3256 tipc_printf(buf, "first_out= %x ", l_ptr->first_out);
3257 tipc_printf(buf, "next_out= %x ", l_ptr->next_out); 3257 tipc_printf(buf, "next_out= %x ", l_ptr->next_out);
diff --git a/net/tipc/ref.c b/net/tipc/ref.c
index 6704a58c7851..c38744c96ed1 100644
--- a/net/tipc/ref.c
+++ b/net/tipc/ref.c
@@ -148,7 +148,7 @@ u32 tipc_ref_acquire(void *object, spinlock_t **lock)
148 reference = (next_plus_upper & ~index_mask) + index; 148 reference = (next_plus_upper & ~index_mask) + index;
149 entry->data.reference = reference; 149 entry->data.reference = reference;
150 entry->object = object; 150 entry->object = object;
151 if (lock != 0) 151 if (lock != NULL)
152 *lock = &entry->lock; 152 *lock = &entry->lock;
153 spin_unlock_bh(&entry->lock); 153 spin_unlock_bh(&entry->lock);
154 } 154 }
diff --git a/net/tipc/zone.c b/net/tipc/zone.c
index 114e173f11a5..3506f8563441 100644
--- a/net/tipc/zone.c
+++ b/net/tipc/zone.c
@@ -82,7 +82,7 @@ void tipc_zone_attach_cluster(struct _zone *z_ptr, struct cluster *c_ptr)
82 82
83 assert(c_ptr->addr); 83 assert(c_ptr->addr);
84 assert(c_num <= tipc_max_clusters); 84 assert(c_num <= tipc_max_clusters);
85 assert(z_ptr->clusters[c_num] == 0); 85 assert(z_ptr->clusters[c_num] == NULL);
86 z_ptr->clusters[c_num] = c_ptr; 86 z_ptr->clusters[c_num] = c_ptr;
87} 87}
88 88
diff --git a/net/wanrouter/wanproc.c b/net/wanrouter/wanproc.c
index f2e54c3f064e..5bebe40bf4e6 100644
--- a/net/wanrouter/wanproc.c
+++ b/net/wanrouter/wanproc.c
@@ -292,14 +292,12 @@ int __init wanrouter_proc_init(void)
292 if (!proc_router) 292 if (!proc_router)
293 goto fail; 293 goto fail;
294 294
295 p = create_proc_entry("config", S_IRUGO, proc_router); 295 p = proc_create("config", S_IRUGO, proc_router, &config_fops);
296 if (!p) 296 if (!p)
297 goto fail_config; 297 goto fail_config;
298 p->proc_fops = &config_fops; 298 p = proc_create("status", S_IRUGO, proc_router, &status_fops);
299 p = create_proc_entry("status", S_IRUGO, proc_router);
300 if (!p) 299 if (!p)
301 goto fail_stat; 300 goto fail_stat;
302 p->proc_fops = &status_fops;
303 return 0; 301 return 0;
304fail_stat: 302fail_stat:
305 remove_proc_entry("config", proc_router); 303 remove_proc_entry("config", proc_router);
@@ -329,10 +327,10 @@ int wanrouter_proc_add(struct wan_device* wandev)
329 if (wandev->magic != ROUTER_MAGIC) 327 if (wandev->magic != ROUTER_MAGIC)
330 return -EINVAL; 328 return -EINVAL;
331 329
332 wandev->dent = create_proc_entry(wandev->name, S_IRUGO, proc_router); 330 wandev->dent = proc_create(wandev->name, S_IRUGO,
331 proc_router, &wandev_fops);
333 if (!wandev->dent) 332 if (!wandev->dent)
334 return -ENOMEM; 333 return -ENOMEM;
335 wandev->dent->proc_fops = &wandev_fops;
336 wandev->dent->data = wandev; 334 wandev->dent->data = wandev;
337 return 0; 335 return 0;
338} 336}
diff --git a/net/x25/x25_proc.c b/net/x25/x25_proc.c
index 3f52b09bed03..1afa44d25beb 100644
--- a/net/x25/x25_proc.c
+++ b/net/x25/x25_proc.c
@@ -312,20 +312,18 @@ int __init x25_proc_init(void)
312 if (!x25_proc_dir) 312 if (!x25_proc_dir)
313 goto out; 313 goto out;
314 314
315 p = create_proc_entry("route", S_IRUGO, x25_proc_dir); 315 p = proc_create("route", S_IRUGO, x25_proc_dir, &x25_seq_route_fops);
316 if (!p) 316 if (!p)
317 goto out_route; 317 goto out_route;
318 p->proc_fops = &x25_seq_route_fops;
319 318
320 p = create_proc_entry("socket", S_IRUGO, x25_proc_dir); 319 p = proc_create("socket", S_IRUGO, x25_proc_dir, &x25_seq_socket_fops);
321 if (!p) 320 if (!p)
322 goto out_socket; 321 goto out_socket;
323 p->proc_fops = &x25_seq_socket_fops;
324 322
325 p = create_proc_entry("forward", S_IRUGO, x25_proc_dir); 323 p = proc_create("forward", S_IRUGO, x25_proc_dir,
324 &x25_seq_forward_fops);
326 if (!p) 325 if (!p)
327 goto out_forward; 326 goto out_forward;
328 p->proc_fops = &x25_seq_forward_fops;
329 rc = 0; 327 rc = 0;
330 328
331out: 329out: