aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2007-02-17 15:11:43 -0500
committerJeff Garzik <jeff@garzik.org>2007-02-17 15:11:43 -0500
commitf630fe2817601314b2eb7ca5ddc23c7834646731 (patch)
tree3bfb4939b7bbc3859575ca8b58fa3f929b015941 /net
parent48c871c1f6a7c7044dd76774fb469e65c7e2e4e8 (diff)
parent8a03d9a498eaf02c8a118752050a5154852c13bf (diff)
Merge branch 'master' into upstream
Diffstat (limited to 'net')
-rw-r--r--net/802/fc.c1
-rw-r--r--net/802/fddi.c1
-rw-r--r--net/802/hippi.c1
-rw-r--r--net/appletalk/sysctl_net_atalk.c2
-rw-r--r--net/atm/addr.c1
-rw-r--r--net/atm/lec.c1
-rw-r--r--net/atm/raw.c1
-rw-r--r--net/ax25/ax25_addr.c1
-rw-r--r--net/ax25/ax25_dev.c1
-rw-r--r--net/ax25/ax25_ds_in.c1
-rw-r--r--net/ax25/ax25_ds_subr.c1
-rw-r--r--net/ax25/ax25_iface.c1
-rw-r--r--net/ax25/ax25_in.c1
-rw-r--r--net/ax25/ax25_ip.c1
-rw-r--r--net/ax25/ax25_out.c1
-rw-r--r--net/ax25/ax25_std_in.c1
-rw-r--r--net/ax25/ax25_std_subr.c1
-rw-r--r--net/ax25/ax25_std_timer.c1
-rw-r--r--net/ax25/ax25_subr.c1
-rw-r--r--net/ax25/ax25_uid.c1
-rw-r--r--net/ax25/sysctl_net_ax25.c2
-rw-r--r--net/bluetooth/bnep/sock.c1
-rw-r--r--net/bluetooth/cmtp/sock.c1
-rw-r--r--net/bluetooth/hci_conn.c1
-rw-r--r--net/bluetooth/hci_event.c1
-rw-r--r--net/bluetooth/hci_sock.c1
-rw-r--r--net/bluetooth/hidp/sock.c1
-rw-r--r--net/bridge/br_if.c8
-rw-r--r--net/bridge/br_netfilter.c2
-rw-r--r--net/bridge/br_notify.c4
-rw-r--r--net/bridge/netfilter/ebtables.c1
-rw-r--r--net/compat.c1
-rw-r--r--net/core/dev_mcast.c1
-rw-r--r--net/core/dst.c1
-rw-r--r--net/core/filter.c1
-rw-r--r--net/core/iovec.c1
-rw-r--r--net/core/neighbour.c3
-rw-r--r--net/core/rtnetlink.c1
-rw-r--r--net/core/skbuff.c1
-rw-r--r--net/dccp/sysctl.c2
-rw-r--r--net/decnet/dn_dev.c7
-rw-r--r--net/decnet/dn_nsp_in.c1
-rw-r--r--net/decnet/dn_nsp_out.c1
-rw-r--r--net/decnet/sysctl_net_decnet.c2
-rw-r--r--net/econet/af_econet.c1
-rw-r--r--net/ethernet/eth.c1
-rw-r--r--net/ipv4/arp.c1
-rw-r--r--net/ipv4/devinet.c10
-rw-r--r--net/ipv4/fib_frontend.c1
-rw-r--r--net/ipv4/fib_hash.c1
-rw-r--r--net/ipv4/fib_trie.c1
-rw-r--r--net/ipv4/inetpeer.c1
-rw-r--r--net/ipv4/ip_forward.c1
-rw-r--r--net/ipv4/ip_gre.c1
-rw-r--r--net/ipv4/ip_output.c1
-rw-r--r--net/ipv4/ip_sockglue.c1
-rw-r--r--net/ipv4/ipip.c7
-rw-r--r--net/ipv4/ipmr.c1
-rw-r--r--net/ipv4/ipvs/ip_vs_ctl.c2
-rw-r--r--net/ipv4/ipvs/ip_vs_lblc.c2
-rw-r--r--net/ipv4/ipvs/ip_vs_lblcr.c2
-rw-r--r--net/ipv4/ipvs/ip_vs_sched.c1
-rw-r--r--net/ipv4/multipath_drr.c1
-rw-r--r--net/ipv4/multipath_random.c1
-rw-r--r--net/ipv4/multipath_rr.c1
-rw-r--r--net/ipv4/multipath_wrandom.c1
-rw-r--r--net/ipv4/netfilter/ip_conntrack_proto_generic.c1
-rw-r--r--net/ipv4/netfilter/ip_conntrack_proto_icmp.c1
-rw-r--r--net/ipv4/netfilter/ip_conntrack_proto_sctp.c3
-rw-r--r--net/ipv4/netfilter/ip_conntrack_proto_tcp.c1
-rw-r--r--net/ipv4/netfilter/ip_conntrack_proto_udp.c1
-rw-r--r--net/ipv4/netfilter/ip_conntrack_standalone.c2
-rw-r--r--net/ipv4/netfilter/ip_queue.c2
-rw-r--r--net/ipv4/netfilter/ipt_REJECT.c4
-rw-r--r--net/ipv4/netfilter/nf_conntrack_proto_icmp.c1
-rw-r--r--net/ipv4/protocol.c1
-rw-r--r--net/ipv4/route.c1
-rw-r--r--net/ipv4/tcp_output.c4
-rw-r--r--net/ipv4/tunnel4.c50
-rw-r--r--net/ipv4/xfrm4_input.c4
-rw-r--r--net/ipv4/xfrm4_mode_tunnel.c1
-rw-r--r--net/ipv4/xfrm4_tunnel.c29
-rw-r--r--net/ipv6/Kconfig1
-rw-r--r--net/ipv6/addrconf.c10
-rw-r--r--net/ipv6/af_inet6.c1
-rw-r--r--net/ipv6/anycast.c1
-rw-r--r--net/ipv6/datagram.c1
-rw-r--r--net/ipv6/exthdrs.c1
-rw-r--r--net/ipv6/icmp.c1
-rw-r--r--net/ipv6/inet6_hashtables.c2
-rw-r--r--net/ipv6/ip6_input.c1
-rw-r--r--net/ipv6/ip6_tunnel.c6
-rw-r--r--net/ipv6/ipv6_sockglue.c1
-rw-r--r--net/ipv6/netfilter/ip6_queue.c2
-rw-r--r--net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c1
-rw-r--r--net/ipv6/proc.c1
-rw-r--r--net/ipv6/protocol.c1
-rw-r--r--net/ipv6/raw.c1
-rw-r--r--net/ipv6/sit.c31
-rw-r--r--net/ipv6/sysctl_net_ipv6.c2
-rw-r--r--net/ipv6/tunnel6.c43
-rw-r--r--net/ipv6/udp.c1
-rw-r--r--net/ipv6/xfrm6_input.c3
-rw-r--r--net/ipv6/xfrm6_tunnel.c19
-rw-r--r--net/ipx/sysctl_net_ipx.c2
-rw-r--r--net/irda/ircomm/ircomm_core.c1
-rw-r--r--net/irda/ircomm/ircomm_event.c1
-rw-r--r--net/irda/ircomm/ircomm_lmp.c1
-rw-r--r--net/irda/ircomm/ircomm_param.c1
-rw-r--r--net/irda/ircomm/ircomm_ttp.c1
-rw-r--r--net/irda/ircomm/ircomm_tty_attach.c1
-rw-r--r--net/irda/ircomm/ircomm_tty_ioctl.c1
-rw-r--r--net/irda/irsysctl.c2
-rw-r--r--net/lapb/lapb_in.c1
-rw-r--r--net/lapb/lapb_out.c1
-rw-r--r--net/lapb/lapb_subr.c1
-rw-r--r--net/llc/sysctl_net_llc.c2
-rw-r--r--net/netfilter/nf_conntrack_proto_generic.c2
-rw-r--r--net/netfilter/nf_conntrack_proto_sctp.c1
-rw-r--r--net/netfilter/nf_conntrack_proto_tcp.c1
-rw-r--r--net/netfilter/nf_conntrack_proto_udp.c1
-rw-r--r--net/netfilter/nf_conntrack_standalone.c2
-rw-r--r--net/netfilter/nf_sysctl.c2
-rw-r--r--net/netfilter/nfnetlink.c1
-rw-r--r--net/netrom/nr_dev.c1
-rw-r--r--net/netrom/nr_in.c1
-rw-r--r--net/netrom/nr_out.c1
-rw-r--r--net/netrom/nr_route.c1
-rw-r--r--net/netrom/nr_subr.c1
-rw-r--r--net/netrom/sysctl_net_netrom.c2
-rw-r--r--net/packet/af_packet.c1
-rw-r--r--net/rose/rose_dev.c1
-rw-r--r--net/rose/rose_in.c1
-rw-r--r--net/rose/rose_out.c1
-rw-r--r--net/rose/rose_route.c1
-rw-r--r--net/rose/rose_subr.c1
-rw-r--r--net/rose/sysctl_net_rose.c2
-rw-r--r--net/rxrpc/sysctl.c2
-rw-r--r--net/rxrpc/transport.c1
-rw-r--r--net/sched/act_api.c1
-rw-r--r--net/sched/act_gact.c1
-rw-r--r--net/sched/act_ipt.c1
-rw-r--r--net/sched/act_mirred.c1
-rw-r--r--net/sched/act_pedit.c1
-rw-r--r--net/sched/act_police.c1
-rw-r--r--net/sched/cls_api.c1
-rw-r--r--net/sched/cls_basic.c1
-rw-r--r--net/sched/cls_fw.c1
-rw-r--r--net/sched/cls_route.c1
-rw-r--r--net/sched/cls_rsvp.c1
-rw-r--r--net/sched/cls_rsvp6.c1
-rw-r--r--net/sched/cls_u32.c1
-rw-r--r--net/sched/em_nbyte.c1
-rw-r--r--net/sched/em_text.c1
-rw-r--r--net/sched/ematch.c1
-rw-r--r--net/sched/sch_api.c1
-rw-r--r--net/sched/sch_cbq.c1
-rw-r--r--net/sched/sch_hfsc.c15
-rw-r--r--net/sched/sch_htb.c1
-rw-r--r--net/sched/sch_prio.c1
-rw-r--r--net/sched/sch_teql.c1
-rw-r--r--net/sctp/associola.c1
-rw-r--r--net/sctp/bind_addr.c1
-rw-r--r--net/sctp/endpointola.c1
-rw-r--r--net/sctp/ipv6.c1
-rw-r--r--net/sctp/sysctl.c2
-rw-r--r--net/sunrpc/auth.c25
-rw-r--r--net/sunrpc/auth_gss/auth_gss.c52
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_crypto.c10
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_mech.c3
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_seal.c2
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_seqnum.c2
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_unseal.c2
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_wrap.c4
-rw-r--r--net/sunrpc/auth_gss/gss_mech_switch.c6
-rw-r--r--net/sunrpc/auth_gss/gss_spkm3_mech.c9
-rw-r--r--net/sunrpc/auth_gss/gss_spkm3_seal.c14
-rw-r--r--net/sunrpc/auth_gss/gss_spkm3_token.c14
-rw-r--r--net/sunrpc/auth_gss/gss_spkm3_unseal.c9
-rw-r--r--net/sunrpc/auth_gss/svcauth_gss.c11
-rw-r--r--net/sunrpc/auth_null.c1
-rw-r--r--net/sunrpc/auth_unix.c9
-rw-r--r--net/sunrpc/cache.c3
-rw-r--r--net/sunrpc/clnt.c145
-rw-r--r--net/sunrpc/pmap_clnt.c26
-rw-r--r--net/sunrpc/rpc_pipe.c2
-rw-r--r--net/sunrpc/sched.c78
-rw-r--r--net/sunrpc/stats.c7
-rw-r--r--net/sunrpc/sunrpc_syms.c6
-rw-r--r--net/sunrpc/svc.c6
-rw-r--r--net/sunrpc/svcauth.c1
-rw-r--r--net/sunrpc/svcauth_unix.c225
-rw-r--r--net/sunrpc/sysctl.c10
-rw-r--r--net/sunrpc/xprt.c67
-rw-r--r--net/sunrpc/xprtsock.c117
-rw-r--r--net/unix/garbage.c1
-rw-r--r--net/unix/sysctl_net_unix.c2
-rw-r--r--net/x25/sysctl_net_x25.c2
-rw-r--r--net/xfrm/xfrm_policy.c2
199 files changed, 764 insertions, 539 deletions
diff --git a/net/802/fc.c b/net/802/fc.c
index d64e6a502958..675d9ba8e591 100644
--- a/net/802/fc.c
+++ b/net/802/fc.c
@@ -14,7 +14,6 @@
14#include <asm/system.h> 14#include <asm/system.h>
15#include <linux/types.h> 15#include <linux/types.h>
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/sched.h>
18#include <linux/string.h> 17#include <linux/string.h>
19#include <linux/mm.h> 18#include <linux/mm.h>
20#include <linux/socket.h> 19#include <linux/socket.h>
diff --git a/net/802/fddi.c b/net/802/fddi.c
index 0b98fe2fa2f6..ace6386384bc 100644
--- a/net/802/fddi.c
+++ b/net/802/fddi.c
@@ -30,7 +30,6 @@
30#include <asm/system.h> 30#include <asm/system.h>
31#include <linux/types.h> 31#include <linux/types.h>
32#include <linux/kernel.h> 32#include <linux/kernel.h>
33#include <linux/sched.h>
34#include <linux/string.h> 33#include <linux/string.h>
35#include <linux/mm.h> 34#include <linux/mm.h>
36#include <linux/socket.h> 35#include <linux/socket.h>
diff --git a/net/802/hippi.c b/net/802/hippi.c
index be0da59323b3..578f2a3d692d 100644
--- a/net/802/hippi.c
+++ b/net/802/hippi.c
@@ -23,7 +23,6 @@
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/types.h> 24#include <linux/types.h>
25#include <linux/kernel.h> 25#include <linux/kernel.h>
26#include <linux/sched.h>
27#include <linux/string.h> 26#include <linux/string.h>
28#include <linux/mm.h> 27#include <linux/mm.h>
29#include <linux/socket.h> 28#include <linux/socket.h>
diff --git a/net/appletalk/sysctl_net_atalk.c b/net/appletalk/sysctl_net_atalk.c
index 40b0af7437a2..7df1778e221a 100644
--- a/net/appletalk/sysctl_net_atalk.c
+++ b/net/appletalk/sysctl_net_atalk.c
@@ -73,7 +73,7 @@ static struct ctl_table_header *atalk_table_header;
73 73
74void atalk_register_sysctl(void) 74void atalk_register_sysctl(void)
75{ 75{
76 atalk_table_header = register_sysctl_table(atalk_root_table, 1); 76 atalk_table_header = register_sysctl_table(atalk_root_table);
77} 77}
78 78
79void atalk_unregister_sysctl(void) 79void atalk_unregister_sysctl(void)
diff --git a/net/atm/addr.c b/net/atm/addr.c
index 3060fd0ba4b9..6afa77d63bb5 100644
--- a/net/atm/addr.c
+++ b/net/atm/addr.c
@@ -4,7 +4,6 @@
4 4
5#include <linux/atm.h> 5#include <linux/atm.h>
6#include <linux/atmdev.h> 6#include <linux/atmdev.h>
7#include <linux/sched.h>
8#include <asm/uaccess.h> 7#include <asm/uaccess.h>
9 8
10#include "signaling.h" 9#include "signaling.h"
diff --git a/net/atm/lec.c b/net/atm/lec.c
index 986945527691..3d804d61f656 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -1437,7 +1437,6 @@ static void lane2_associate_ind(struct net_device *dev, u8 *mac_addr,
1437 */ 1437 */
1438 1438
1439#include <linux/types.h> 1439#include <linux/types.h>
1440#include <linux/sched.h>
1441#include <linux/timer.h> 1440#include <linux/timer.h>
1442#include <asm/param.h> 1441#include <asm/param.h>
1443#include <asm/atomic.h> 1442#include <asm/atomic.h>
diff --git a/net/atm/raw.c b/net/atm/raw.c
index 4df7cdd72aa1..1378f61c5c31 100644
--- a/net/atm/raw.c
+++ b/net/atm/raw.c
@@ -4,7 +4,6 @@
4 4
5 5
6#include <linux/module.h> 6#include <linux/module.h>
7#include <linux/sched.h>
8#include <linux/atmdev.h> 7#include <linux/atmdev.h>
9#include <linux/capability.h> 8#include <linux/capability.h>
10#include <linux/kernel.h> 9#include <linux/kernel.h>
diff --git a/net/ax25/ax25_addr.c b/net/ax25/ax25_addr.c
index 419e7188d5a7..7e7964dd987b 100644
--- a/net/ax25/ax25_addr.c
+++ b/net/ax25/ax25_addr.c
@@ -12,7 +12,6 @@
12#include <linux/in.h> 12#include <linux/in.h>
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/sched.h>
16#include <linux/timer.h> 15#include <linux/timer.h>
17#include <linux/string.h> 16#include <linux/string.h>
18#include <linux/sockios.h> 17#include <linux/sockios.h>
diff --git a/net/ax25/ax25_dev.c b/net/ax25/ax25_dev.c
index b787678220ff..528c874d9828 100644
--- a/net/ax25/ax25_dev.c
+++ b/net/ax25/ax25_dev.c
@@ -11,7 +11,6 @@
11#include <linux/socket.h> 11#include <linux/socket.h>
12#include <linux/in.h> 12#include <linux/in.h>
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/sched.h>
15#include <linux/timer.h> 14#include <linux/timer.h>
16#include <linux/string.h> 15#include <linux/string.h>
17#include <linux/sockios.h> 16#include <linux/sockios.h>
diff --git a/net/ax25/ax25_ds_in.c b/net/ax25/ax25_ds_in.c
index edcaa897027c..e37d217a986a 100644
--- a/net/ax25/ax25_ds_in.c
+++ b/net/ax25/ax25_ds_in.c
@@ -12,7 +12,6 @@
12#include <linux/socket.h> 12#include <linux/socket.h>
13#include <linux/in.h> 13#include <linux/in.h>
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/sched.h>
16#include <linux/timer.h> 15#include <linux/timer.h>
17#include <linux/string.h> 16#include <linux/string.h>
18#include <linux/sockios.h> 17#include <linux/sockios.h>
diff --git a/net/ax25/ax25_ds_subr.c b/net/ax25/ax25_ds_subr.c
index 4d22d4430ec8..9569dd3fa466 100644
--- a/net/ax25/ax25_ds_subr.c
+++ b/net/ax25/ax25_ds_subr.c
@@ -12,7 +12,6 @@
12#include <linux/socket.h> 12#include <linux/socket.h>
13#include <linux/in.h> 13#include <linux/in.h>
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/sched.h>
16#include <linux/timer.h> 15#include <linux/timer.h>
17#include <linux/string.h> 16#include <linux/string.h>
18#include <linux/sockios.h> 17#include <linux/sockios.h>
diff --git a/net/ax25/ax25_iface.c b/net/ax25/ax25_iface.c
index aff3e652c2d1..16be0c14780a 100644
--- a/net/ax25/ax25_iface.c
+++ b/net/ax25/ax25_iface.c
@@ -12,7 +12,6 @@
12#include <linux/in.h> 12#include <linux/in.h>
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/sched.h>
16#include <linux/spinlock.h> 15#include <linux/spinlock.h>
17#include <linux/timer.h> 16#include <linux/timer.h>
18#include <linux/string.h> 17#include <linux/string.h>
diff --git a/net/ax25/ax25_in.c b/net/ax25/ax25_in.c
index e9d94291581e..4a6b26becadc 100644
--- a/net/ax25/ax25_in.c
+++ b/net/ax25/ax25_in.c
@@ -14,7 +14,6 @@
14#include <linux/socket.h> 14#include <linux/socket.h>
15#include <linux/in.h> 15#include <linux/in.h>
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/sched.h>
18#include <linux/timer.h> 17#include <linux/timer.h>
19#include <linux/string.h> 18#include <linux/string.h>
20#include <linux/sockios.h> 19#include <linux/sockios.h>
diff --git a/net/ax25/ax25_ip.c b/net/ax25/ax25_ip.c
index 8d62d8681615..7f818bbcd1c5 100644
--- a/net/ax25/ax25_ip.c
+++ b/net/ax25/ax25_ip.c
@@ -12,7 +12,6 @@
12#include <linux/in.h> 12#include <linux/in.h>
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/sched.h>
16#include <linux/timer.h> 15#include <linux/timer.h>
17#include <linux/string.h> 16#include <linux/string.h>
18#include <linux/sockios.h> 17#include <linux/sockios.h>
diff --git a/net/ax25/ax25_out.c b/net/ax25/ax25_out.c
index f84047d1e8ce..223835092b7a 100644
--- a/net/ax25/ax25_out.c
+++ b/net/ax25/ax25_out.c
@@ -14,7 +14,6 @@
14#include <linux/in.h> 14#include <linux/in.h>
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/sched.h>
18#include <linux/timer.h> 17#include <linux/timer.h>
19#include <linux/string.h> 18#include <linux/string.h>
20#include <linux/sockios.h> 19#include <linux/sockios.h>
diff --git a/net/ax25/ax25_std_in.c b/net/ax25/ax25_std_in.c
index f6ed283e9de8..a8eef88d8652 100644
--- a/net/ax25/ax25_std_in.c
+++ b/net/ax25/ax25_std_in.c
@@ -19,7 +19,6 @@
19#include <linux/socket.h> 19#include <linux/socket.h>
20#include <linux/in.h> 20#include <linux/in.h>
21#include <linux/kernel.h> 21#include <linux/kernel.h>
22#include <linux/sched.h>
23#include <linux/timer.h> 22#include <linux/timer.h>
24#include <linux/string.h> 23#include <linux/string.h>
25#include <linux/sockios.h> 24#include <linux/sockios.h>
diff --git a/net/ax25/ax25_std_subr.c b/net/ax25/ax25_std_subr.c
index 2b3c801ae486..277f81bb979a 100644
--- a/net/ax25/ax25_std_subr.c
+++ b/net/ax25/ax25_std_subr.c
@@ -11,7 +11,6 @@
11#include <linux/socket.h> 11#include <linux/socket.h>
12#include <linux/in.h> 12#include <linux/in.h>
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/sched.h>
15#include <linux/timer.h> 14#include <linux/timer.h>
16#include <linux/string.h> 15#include <linux/string.h>
17#include <linux/sockios.h> 16#include <linux/sockios.h>
diff --git a/net/ax25/ax25_std_timer.c b/net/ax25/ax25_std_timer.c
index e3528b1a7802..f2f6918ac9bb 100644
--- a/net/ax25/ax25_std_timer.c
+++ b/net/ax25/ax25_std_timer.c
@@ -14,7 +14,6 @@
14#include <linux/socket.h> 14#include <linux/socket.h>
15#include <linux/in.h> 15#include <linux/in.h>
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/sched.h>
18#include <linux/timer.h> 17#include <linux/timer.h>
19#include <linux/string.h> 18#include <linux/string.h>
20#include <linux/sockios.h> 19#include <linux/sockios.h>
diff --git a/net/ax25/ax25_subr.c b/net/ax25/ax25_subr.c
index 85c58c49b4d0..b6c577e3c914 100644
--- a/net/ax25/ax25_subr.c
+++ b/net/ax25/ax25_subr.c
@@ -14,7 +14,6 @@
14#include <linux/socket.h> 14#include <linux/socket.h>
15#include <linux/in.h> 15#include <linux/in.h>
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/sched.h>
18#include <linux/timer.h> 17#include <linux/timer.h>
19#include <linux/string.h> 18#include <linux/string.h>
20#include <linux/sockios.h> 19#include <linux/sockios.h>
diff --git a/net/ax25/ax25_uid.c b/net/ax25/ax25_uid.c
index 59a41b1e61f5..75c76647b2cb 100644
--- a/net/ax25/ax25_uid.c
+++ b/net/ax25/ax25_uid.c
@@ -13,7 +13,6 @@
13#include <linux/socket.h> 13#include <linux/socket.h>
14#include <linux/in.h> 14#include <linux/in.h>
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/sched.h>
17#include <linux/timer.h> 16#include <linux/timer.h>
18#include <linux/string.h> 17#include <linux/string.h>
19#include <linux/sockios.h> 18#include <linux/sockios.h>
diff --git a/net/ax25/sysctl_net_ax25.c b/net/ax25/sysctl_net_ax25.c
index d23a27f25d2f..443a83676638 100644
--- a/net/ax25/sysctl_net_ax25.c
+++ b/net/ax25/sysctl_net_ax25.c
@@ -245,7 +245,7 @@ void ax25_register_sysctl(void)
245 245
246 ax25_dir_table[0].child = ax25_table; 246 ax25_dir_table[0].child = ax25_table;
247 247
248 ax25_table_header = register_sysctl_table(ax25_root_table, 1); 248 ax25_table_header = register_sysctl_table(ax25_root_table);
249} 249}
250 250
251void ax25_unregister_sysctl(void) 251void ax25_unregister_sysctl(void)
diff --git a/net/bluetooth/bnep/sock.c b/net/bluetooth/bnep/sock.c
index 6d7311cee1b4..10292e776046 100644
--- a/net/bluetooth/bnep/sock.c
+++ b/net/bluetooth/bnep/sock.c
@@ -34,7 +34,6 @@
34#include <linux/capability.h> 34#include <linux/capability.h>
35#include <linux/errno.h> 35#include <linux/errno.h>
36#include <linux/kernel.h> 36#include <linux/kernel.h>
37#include <linux/sched.h>
38#include <linux/slab.h> 37#include <linux/slab.h>
39#include <linux/poll.h> 38#include <linux/poll.h>
40#include <linux/fcntl.h> 39#include <linux/fcntl.h>
diff --git a/net/bluetooth/cmtp/sock.c b/net/bluetooth/cmtp/sock.c
index 0c5ccd95517f..19be7861e51e 100644
--- a/net/bluetooth/cmtp/sock.c
+++ b/net/bluetooth/cmtp/sock.c
@@ -26,7 +26,6 @@
26#include <linux/capability.h> 26#include <linux/capability.h>
27#include <linux/errno.h> 27#include <linux/errno.h>
28#include <linux/kernel.h> 28#include <linux/kernel.h>
29#include <linux/sched.h>
30#include <linux/slab.h> 29#include <linux/slab.h>
31#include <linux/poll.h> 30#include <linux/poll.h>
32#include <linux/fcntl.h> 31#include <linux/fcntl.h>
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 67ee0bd80f5f..f3403fdb59f8 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -29,7 +29,6 @@
29#include <linux/types.h> 29#include <linux/types.h>
30#include <linux/errno.h> 30#include <linux/errno.h>
31#include <linux/kernel.h> 31#include <linux/kernel.h>
32#include <linux/sched.h>
33#include <linux/slab.h> 32#include <linux/slab.h>
34#include <linux/poll.h> 33#include <linux/poll.h>
35#include <linux/fcntl.h> 34#include <linux/fcntl.h>
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 00d845e3d307..936d3fc479cd 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -29,7 +29,6 @@
29#include <linux/types.h> 29#include <linux/types.h>
30#include <linux/errno.h> 30#include <linux/errno.h>
31#include <linux/kernel.h> 31#include <linux/kernel.h>
32#include <linux/sched.h>
33#include <linux/slab.h> 32#include <linux/slab.h>
34#include <linux/poll.h> 33#include <linux/poll.h>
35#include <linux/fcntl.h> 34#include <linux/fcntl.h>
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index dc3ecb19a5cd..f928d2b2a17d 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -30,7 +30,6 @@
30#include <linux/capability.h> 30#include <linux/capability.h>
31#include <linux/errno.h> 31#include <linux/errno.h>
32#include <linux/kernel.h> 32#include <linux/kernel.h>
33#include <linux/sched.h>
34#include <linux/slab.h> 33#include <linux/slab.h>
35#include <linux/poll.h> 34#include <linux/poll.h>
36#include <linux/fcntl.h> 35#include <linux/fcntl.h>
diff --git a/net/bluetooth/hidp/sock.c b/net/bluetooth/hidp/sock.c
index 33bda40aceb8..8b8a6c1dbd99 100644
--- a/net/bluetooth/hidp/sock.c
+++ b/net/bluetooth/hidp/sock.c
@@ -26,7 +26,6 @@
26#include <linux/capability.h> 26#include <linux/capability.h>
27#include <linux/errno.h> 27#include <linux/errno.h>
28#include <linux/kernel.h> 28#include <linux/kernel.h>
29#include <linux/sched.h>
30#include <linux/slab.h> 29#include <linux/slab.h>
31#include <linux/poll.h> 30#include <linux/poll.h>
32#include <linux/fcntl.h> 31#include <linux/fcntl.h>
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index f35c1a378d0f..aff6a779c9c8 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -108,6 +108,7 @@ static void port_carrier_check(struct work_struct *work)
108 spin_unlock_bh(&br->lock); 108 spin_unlock_bh(&br->lock);
109 } 109 }
110done: 110done:
111 dev_put(dev);
111 rtnl_unlock(); 112 rtnl_unlock();
112} 113}
113 114
@@ -161,7 +162,8 @@ static void del_nbp(struct net_bridge_port *p)
161 162
162 dev_set_promiscuity(dev, -1); 163 dev_set_promiscuity(dev, -1);
163 164
164 cancel_delayed_work(&p->carrier_check); 165 if (cancel_delayed_work(&p->carrier_check))
166 dev_put(dev);
165 167
166 spin_lock_bh(&br->lock); 168 spin_lock_bh(&br->lock);
167 br_stp_disable_port(p); 169 br_stp_disable_port(p);
@@ -444,7 +446,9 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
444 spin_lock_bh(&br->lock); 446 spin_lock_bh(&br->lock);
445 br_stp_recalculate_bridge_id(br); 447 br_stp_recalculate_bridge_id(br);
446 br_features_recompute(br); 448 br_features_recompute(br);
447 schedule_delayed_work(&p->carrier_check, BR_PORT_DEBOUNCE); 449 if (schedule_delayed_work(&p->carrier_check, BR_PORT_DEBOUNCE))
450 dev_hold(dev);
451
448 spin_unlock_bh(&br->lock); 452 spin_unlock_bh(&br->lock);
449 453
450 dev_set_mtu(br->dev, br_min_mtu(br)); 454 dev_set_mtu(br->dev, br_min_mtu(br));
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index a0744e653f09..7712d76f06ba 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -957,7 +957,7 @@ int __init br_netfilter_init(void)
957 if (ret < 0) 957 if (ret < 0)
958 return ret; 958 return ret;
959#ifdef CONFIG_SYSCTL 959#ifdef CONFIG_SYSCTL
960 brnf_sysctl_header = register_sysctl_table(brnf_net_table, 0); 960 brnf_sysctl_header = register_sysctl_table(brnf_net_table);
961 if (brnf_sysctl_header == NULL) { 961 if (brnf_sysctl_header == NULL) {
962 printk(KERN_WARNING 962 printk(KERN_WARNING
963 "br_netfilter: can't register to sysctl.\n"); 963 "br_netfilter: can't register to sysctl.\n");
diff --git a/net/bridge/br_notify.c b/net/bridge/br_notify.c
index 8cd3e4229070..3311c4e30829 100644
--- a/net/bridge/br_notify.c
+++ b/net/bridge/br_notify.c
@@ -56,7 +56,9 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v
56 56
57 case NETDEV_CHANGE: 57 case NETDEV_CHANGE:
58 if (br->dev->flags & IFF_UP) 58 if (br->dev->flags & IFF_UP)
59 schedule_delayed_work(&p->carrier_check, BR_PORT_DEBOUNCE); 59 if (schedule_delayed_work(&p->carrier_check,
60 BR_PORT_DEBOUNCE))
61 dev_hold(dev);
60 break; 62 break;
61 63
62 case NETDEV_FEAT_CHANGE: 64 case NETDEV_FEAT_CHANGE:
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
index 5818d70b8e8d..34c49799f9b3 100644
--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
@@ -16,7 +16,6 @@
16 */ 16 */
17 17
18/* used for print_string */ 18/* used for print_string */
19#include <linux/sched.h>
20#include <linux/tty.h> 19#include <linux/tty.h>
21 20
22#include <linux/kmod.h> 21#include <linux/kmod.h>
diff --git a/net/compat.c b/net/compat.c
index 9c970749a3b0..1f32866d09b7 100644
--- a/net/compat.c
+++ b/net/compat.c
@@ -13,7 +13,6 @@
13 13
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/fs.h> 15#include <linux/fs.h>
16#include <linux/sched.h>
17#include <linux/types.h> 16#include <linux/types.h>
18#include <linux/file.h> 17#include <linux/file.h>
19#include <linux/icmpv6.h> 18#include <linux/icmpv6.h>
diff --git a/net/core/dev_mcast.c b/net/core/dev_mcast.c
index c4e754e86e96..56b310c0c860 100644
--- a/net/core/dev_mcast.c
+++ b/net/core/dev_mcast.c
@@ -27,7 +27,6 @@
27#include <linux/bitops.h> 27#include <linux/bitops.h>
28#include <linux/types.h> 28#include <linux/types.h>
29#include <linux/kernel.h> 29#include <linux/kernel.h>
30#include <linux/sched.h>
31#include <linux/string.h> 30#include <linux/string.h>
32#include <linux/mm.h> 31#include <linux/mm.h>
33#include <linux/socket.h> 32#include <linux/socket.h>
diff --git a/net/core/dst.c b/net/core/dst.c
index 61dd9d3951f1..764bccb3d992 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -12,7 +12,6 @@
12#include <linux/mm.h> 12#include <linux/mm.h>
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/netdevice.h> 14#include <linux/netdevice.h>
15#include <linux/sched.h>
16#include <linux/skbuff.h> 15#include <linux/skbuff.h>
17#include <linux/string.h> 16#include <linux/string.h>
18#include <linux/types.h> 17#include <linux/types.h>
diff --git a/net/core/filter.c b/net/core/filter.c
index 8123a31d919d..8d185a089c53 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -18,7 +18,6 @@
18 18
19#include <linux/module.h> 19#include <linux/module.h>
20#include <linux/types.h> 20#include <linux/types.h>
21#include <linux/sched.h>
22#include <linux/mm.h> 21#include <linux/mm.h>
23#include <linux/fcntl.h> 22#include <linux/fcntl.h>
24#include <linux/socket.h> 23#include <linux/socket.h>
diff --git a/net/core/iovec.c b/net/core/iovec.c
index 4fb1cb9b79b9..755c37fdaee7 100644
--- a/net/core/iovec.c
+++ b/net/core/iovec.c
@@ -18,7 +18,6 @@
18 18
19#include <linux/errno.h> 19#include <linux/errno.h>
20#include <linux/module.h> 20#include <linux/module.h>
21#include <linux/sched.h>
22#include <linux/kernel.h> 21#include <linux/kernel.h>
23#include <linux/mm.h> 22#include <linux/mm.h>
24#include <linux/slab.h> 23#include <linux/slab.h>
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 512eed91785d..3183142c6044 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -19,7 +19,6 @@
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/module.h> 20#include <linux/module.h>
21#include <linux/socket.h> 21#include <linux/socket.h>
22#include <linux/sched.h>
23#include <linux/netdevice.h> 22#include <linux/netdevice.h>
24#include <linux/proc_fs.h> 23#include <linux/proc_fs.h>
25#ifdef CONFIG_SYSCTL 24#ifdef CONFIG_SYSCTL
@@ -2708,7 +2707,7 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
2708 t->neigh_proto_dir[0].child = t->neigh_neigh_dir; 2707 t->neigh_proto_dir[0].child = t->neigh_neigh_dir;
2709 t->neigh_root_dir[0].child = t->neigh_proto_dir; 2708 t->neigh_root_dir[0].child = t->neigh_proto_dir;
2710 2709
2711 t->sysctl_header = register_sysctl_table(t->neigh_root_dir, 0); 2710 t->sysctl_header = register_sysctl_table(t->neigh_root_dir);
2712 if (!t->sysctl_header) { 2711 if (!t->sysctl_header) {
2713 err = -ENOBUFS; 2712 err = -ENOBUFS;
2714 goto free_procname; 2713 goto free_procname;
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index ee5a787271f6..6055074c4b81 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -21,7 +21,6 @@
21#include <linux/types.h> 21#include <linux/types.h>
22#include <linux/socket.h> 22#include <linux/socket.h>
23#include <linux/kernel.h> 23#include <linux/kernel.h>
24#include <linux/sched.h>
25#include <linux/timer.h> 24#include <linux/timer.h>
26#include <linux/string.h> 25#include <linux/string.h>
27#include <linux/sockios.h> 26#include <linux/sockios.h>
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 3d5646869022..f89ff151cfab 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -41,7 +41,6 @@
41#include <linux/module.h> 41#include <linux/module.h>
42#include <linux/types.h> 42#include <linux/types.h>
43#include <linux/kernel.h> 43#include <linux/kernel.h>
44#include <linux/sched.h>
45#include <linux/mm.h> 44#include <linux/mm.h>
46#include <linux/interrupt.h> 45#include <linux/interrupt.h>
47#include <linux/in.h> 46#include <linux/in.h>
diff --git a/net/dccp/sysctl.c b/net/dccp/sysctl.c
index fdcfca3e9208..1260aabac5e1 100644
--- a/net/dccp/sysctl.c
+++ b/net/dccp/sysctl.c
@@ -127,7 +127,7 @@ static struct ctl_table_header *dccp_table_header;
127 127
128int __init dccp_sysctl_init(void) 128int __init dccp_sysctl_init(void)
129{ 129{
130 dccp_table_header = register_sysctl_table(dccp_root_table, 1); 130 dccp_table_header = register_sysctl_table(dccp_root_table);
131 131
132 return dccp_table_header != NULL ? 0 : -ENOMEM; 132 return dccp_table_header != NULL ? 0 : -ENOMEM;
133} 133}
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
index 2b2c7fe45a71..060d725e2942 100644
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -261,7 +261,6 @@ static void dn_dev_sysctl_register(struct net_device *dev, struct dn_dev_parms *
261 for(i = 0; i < ARRAY_SIZE(t->dn_dev_vars) - 1; i++) { 261 for(i = 0; i < ARRAY_SIZE(t->dn_dev_vars) - 1; i++) {
262 long offset = (long)t->dn_dev_vars[i].data; 262 long offset = (long)t->dn_dev_vars[i].data;
263 t->dn_dev_vars[i].data = ((char *)parms) + offset; 263 t->dn_dev_vars[i].data = ((char *)parms) + offset;
264 t->dn_dev_vars[i].de = NULL;
265 } 264 }
266 265
267 if (dev) { 266 if (dev) {
@@ -273,16 +272,12 @@ static void dn_dev_sysctl_register(struct net_device *dev, struct dn_dev_parms *
273 } 272 }
274 273
275 t->dn_dev_dev[0].child = t->dn_dev_vars; 274 t->dn_dev_dev[0].child = t->dn_dev_vars;
276 t->dn_dev_dev[0].de = NULL;
277 t->dn_dev_conf_dir[0].child = t->dn_dev_dev; 275 t->dn_dev_conf_dir[0].child = t->dn_dev_dev;
278 t->dn_dev_conf_dir[0].de = NULL;
279 t->dn_dev_proto_dir[0].child = t->dn_dev_conf_dir; 276 t->dn_dev_proto_dir[0].child = t->dn_dev_conf_dir;
280 t->dn_dev_proto_dir[0].de = NULL;
281 t->dn_dev_root_dir[0].child = t->dn_dev_proto_dir; 277 t->dn_dev_root_dir[0].child = t->dn_dev_proto_dir;
282 t->dn_dev_root_dir[0].de = NULL;
283 t->dn_dev_vars[0].extra1 = (void *)dev; 278 t->dn_dev_vars[0].extra1 = (void *)dev;
284 279
285 t->sysctl_header = register_sysctl_table(t->dn_dev_root_dir, 0); 280 t->sysctl_header = register_sysctl_table(t->dn_dev_root_dir);
286 if (t->sysctl_header == NULL) 281 if (t->sysctl_header == NULL)
287 kfree(t); 282 kfree(t);
288 else 283 else
diff --git a/net/decnet/dn_nsp_in.c b/net/decnet/dn_nsp_in.c
index 0f244e81a377..9d20904f6f52 100644
--- a/net/decnet/dn_nsp_in.c
+++ b/net/decnet/dn_nsp_in.c
@@ -50,7 +50,6 @@
50#include <linux/socket.h> 50#include <linux/socket.h>
51#include <linux/in.h> 51#include <linux/in.h>
52#include <linux/kernel.h> 52#include <linux/kernel.h>
53#include <linux/sched.h>
54#include <linux/timer.h> 53#include <linux/timer.h>
55#include <linux/string.h> 54#include <linux/string.h>
56#include <linux/sockios.h> 55#include <linux/sockios.h>
diff --git a/net/decnet/dn_nsp_out.c b/net/decnet/dn_nsp_out.c
index 23d5ca88dfa3..2d2cda82c7db 100644
--- a/net/decnet/dn_nsp_out.c
+++ b/net/decnet/dn_nsp_out.c
@@ -43,7 +43,6 @@
43#include <linux/socket.h> 43#include <linux/socket.h>
44#include <linux/in.h> 44#include <linux/in.h>
45#include <linux/kernel.h> 45#include <linux/kernel.h>
46#include <linux/sched.h>
47#include <linux/timer.h> 46#include <linux/timer.h>
48#include <linux/string.h> 47#include <linux/string.h>
49#include <linux/sockios.h> 48#include <linux/sockios.h>
diff --git a/net/decnet/sysctl_net_decnet.c b/net/decnet/sysctl_net_decnet.c
index a6c067b593ab..52e40d7eb22d 100644
--- a/net/decnet/sysctl_net_decnet.c
+++ b/net/decnet/sysctl_net_decnet.c
@@ -491,7 +491,7 @@ static ctl_table dn_root_table[] = {
491 491
492void dn_register_sysctl(void) 492void dn_register_sysctl(void)
493{ 493{
494 dn_table_header = register_sysctl_table(dn_root_table, 1); 494 dn_table_header = register_sysctl_table(dn_root_table);
495} 495}
496 496
497void dn_unregister_sysctl(void) 497void dn_unregister_sysctl(void)
diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c
index f2ce41434290..bc12e36263f0 100644
--- a/net/econet/af_econet.c
+++ b/net/econet/af_econet.c
@@ -13,7 +13,6 @@
13 13
14#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/sched.h>
17#include <linux/string.h> 16#include <linux/string.h>
18#include <linux/mm.h> 17#include <linux/mm.h>
19#include <linux/socket.h> 18#include <linux/socket.h>
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index 766a0b59c0d3..7391f55904d1 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -40,7 +40,6 @@
40#include <linux/module.h> 40#include <linux/module.h>
41#include <linux/types.h> 41#include <linux/types.h>
42#include <linux/kernel.h> 42#include <linux/kernel.h>
43#include <linux/sched.h>
44#include <linux/string.h> 43#include <linux/string.h>
45#include <linux/mm.h> 44#include <linux/mm.h>
46#include <linux/socket.h> 45#include <linux/socket.h>
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 0ffd2d2920c3..1a3488a83f49 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -78,7 +78,6 @@
78#include <linux/types.h> 78#include <linux/types.h>
79#include <linux/string.h> 79#include <linux/string.h>
80#include <linux/kernel.h> 80#include <linux/kernel.h>
81#include <linux/sched.h>
82#include <linux/capability.h> 81#include <linux/capability.h>
83#include <linux/socket.h> 82#include <linux/socket.h>
84#include <linux/sockios.h> 83#include <linux/sockios.h>
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index ba5e7f4cd127..8a0ec10a13a7 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -35,7 +35,6 @@
35#include <linux/module.h> 35#include <linux/module.h>
36#include <linux/types.h> 36#include <linux/types.h>
37#include <linux/kernel.h> 37#include <linux/kernel.h>
38#include <linux/sched.h>
39#include <linux/string.h> 38#include <linux/string.h>
40#include <linux/mm.h> 39#include <linux/mm.h>
41#include <linux/socket.h> 40#include <linux/socket.h>
@@ -1577,7 +1576,6 @@ static void devinet_sysctl_register(struct in_device *in_dev,
1577 return; 1576 return;
1578 for (i = 0; i < ARRAY_SIZE(t->devinet_vars) - 1; i++) { 1577 for (i = 0; i < ARRAY_SIZE(t->devinet_vars) - 1; i++) {
1579 t->devinet_vars[i].data += (char *)p - (char *)&ipv4_devconf; 1578 t->devinet_vars[i].data += (char *)p - (char *)&ipv4_devconf;
1580 t->devinet_vars[i].de = NULL;
1581 } 1579 }
1582 1580
1583 if (dev) { 1581 if (dev) {
@@ -1599,15 +1597,11 @@ static void devinet_sysctl_register(struct in_device *in_dev,
1599 1597
1600 t->devinet_dev[0].procname = dev_name; 1598 t->devinet_dev[0].procname = dev_name;
1601 t->devinet_dev[0].child = t->devinet_vars; 1599 t->devinet_dev[0].child = t->devinet_vars;
1602 t->devinet_dev[0].de = NULL;
1603 t->devinet_conf_dir[0].child = t->devinet_dev; 1600 t->devinet_conf_dir[0].child = t->devinet_dev;
1604 t->devinet_conf_dir[0].de = NULL;
1605 t->devinet_proto_dir[0].child = t->devinet_conf_dir; 1601 t->devinet_proto_dir[0].child = t->devinet_conf_dir;
1606 t->devinet_proto_dir[0].de = NULL;
1607 t->devinet_root_dir[0].child = t->devinet_proto_dir; 1602 t->devinet_root_dir[0].child = t->devinet_proto_dir;
1608 t->devinet_root_dir[0].de = NULL;
1609 1603
1610 t->sysctl_header = register_sysctl_table(t->devinet_root_dir, 0); 1604 t->sysctl_header = register_sysctl_table(t->devinet_root_dir);
1611 if (!t->sysctl_header) 1605 if (!t->sysctl_header)
1612 goto free_procname; 1606 goto free_procname;
1613 1607
@@ -1641,7 +1635,7 @@ void __init devinet_init(void)
1641 rtnetlink_links[PF_INET] = inet_rtnetlink_table; 1635 rtnetlink_links[PF_INET] = inet_rtnetlink_table;
1642#ifdef CONFIG_SYSCTL 1636#ifdef CONFIG_SYSCTL
1643 devinet_sysctl.sysctl_header = 1637 devinet_sysctl.sysctl_header =
1644 register_sysctl_table(devinet_sysctl.devinet_root_dir, 0); 1638 register_sysctl_table(devinet_sysctl.devinet_root_dir);
1645 devinet_sysctl_register(NULL, &ipv4_devconf_dflt); 1639 devinet_sysctl_register(NULL, &ipv4_devconf_dflt);
1646#endif 1640#endif
1647} 1641}
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 64f31e63db7f..1fba6439fc57 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -22,7 +22,6 @@
22#include <linux/capability.h> 22#include <linux/capability.h>
23#include <linux/types.h> 23#include <linux/types.h>
24#include <linux/kernel.h> 24#include <linux/kernel.h>
25#include <linux/sched.h>
26#include <linux/mm.h> 25#include <linux/mm.h>
27#include <linux/string.h> 26#include <linux/string.h>
28#include <linux/socket.h> 27#include <linux/socket.h>
diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c
index b21bb28d1fd0..a4949f957ab5 100644
--- a/net/ipv4/fib_hash.c
+++ b/net/ipv4/fib_hash.c
@@ -20,7 +20,6 @@
20#include <linux/bitops.h> 20#include <linux/bitops.h>
21#include <linux/types.h> 21#include <linux/types.h>
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/sched.h>
24#include <linux/mm.h> 23#include <linux/mm.h>
25#include <linux/string.h> 24#include <linux/string.h>
26#include <linux/socket.h> 25#include <linux/socket.h>
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index c33dca073801..72b3036bbc09 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -57,7 +57,6 @@
57#include <asm/bitops.h> 57#include <asm/bitops.h>
58#include <linux/types.h> 58#include <linux/types.h>
59#include <linux/kernel.h> 59#include <linux/kernel.h>
60#include <linux/sched.h>
61#include <linux/mm.h> 60#include <linux/mm.h>
62#include <linux/string.h> 61#include <linux/string.h>
63#include <linux/socket.h> 62#include <linux/socket.h>
diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c
index 711eb6d0285a..db3ef96bdfd9 100644
--- a/net/ipv4/inetpeer.c
+++ b/net/ipv4/inetpeer.c
@@ -14,7 +14,6 @@
14#include <linux/interrupt.h> 14#include <linux/interrupt.h>
15#include <linux/spinlock.h> 15#include <linux/spinlock.h>
16#include <linux/random.h> 16#include <linux/random.h>
17#include <linux/sched.h>
18#include <linux/timer.h> 17#include <linux/timer.h>
19#include <linux/time.h> 18#include <linux/time.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c
index c3ea0cd2e584..369e721c4bab 100644
--- a/net/ipv4/ip_forward.c
+++ b/net/ipv4/ip_forward.c
@@ -23,7 +23,6 @@
23 23
24#include <linux/types.h> 24#include <linux/types.h>
25#include <linux/mm.h> 25#include <linux/mm.h>
26#include <linux/sched.h>
27#include <linux/skbuff.h> 26#include <linux/skbuff.h>
28#include <linux/ip.h> 27#include <linux/ip.h>
29#include <linux/icmp.h> 28#include <linux/icmp.h>
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index f12c0d6623a0..9151da642318 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -13,7 +13,6 @@
13#include <linux/capability.h> 13#include <linux/capability.h>
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/types.h> 15#include <linux/types.h>
16#include <linux/sched.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <asm/uaccess.h> 17#include <asm/uaccess.h>
19#include <linux/skbuff.h> 18#include <linux/skbuff.h>
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index bb0bb8f07c54..d096332f6c6d 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -49,7 +49,6 @@
49#include <linux/module.h> 49#include <linux/module.h>
50#include <linux/types.h> 50#include <linux/types.h>
51#include <linux/kernel.h> 51#include <linux/kernel.h>
52#include <linux/sched.h>
53#include <linux/mm.h> 52#include <linux/mm.h>
54#include <linux/string.h> 53#include <linux/string.h>
55#include <linux/errno.h> 54#include <linux/errno.h>
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index e120686c3cb8..23048d9f3584 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -20,7 +20,6 @@
20#include <linux/module.h> 20#include <linux/module.h>
21#include <linux/types.h> 21#include <linux/types.h>
22#include <linux/mm.h> 22#include <linux/mm.h>
23#include <linux/sched.h>
24#include <linux/skbuff.h> 23#include <linux/skbuff.h>
25#include <linux/ip.h> 24#include <linux/ip.h>
26#include <linux/icmp.h> 25#include <linux/icmp.h>
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index 475bcd1e4181..3ec5ce0f5498 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -96,7 +96,6 @@
96#include <linux/capability.h> 96#include <linux/capability.h>
97#include <linux/module.h> 97#include <linux/module.h>
98#include <linux/types.h> 98#include <linux/types.h>
99#include <linux/sched.h>
100#include <linux/kernel.h> 99#include <linux/kernel.h>
101#include <asm/uaccess.h> 100#include <asm/uaccess.h>
102#include <linux/skbuff.h> 101#include <linux/skbuff.h>
@@ -871,7 +870,7 @@ static int __init ipip_init(void)
871 870
872 printk(banner); 871 printk(banner);
873 872
874 if (xfrm4_tunnel_register(&ipip_handler)) { 873 if (xfrm4_tunnel_register(&ipip_handler, AF_INET)) {
875 printk(KERN_INFO "ipip init: can't register tunnel\n"); 874 printk(KERN_INFO "ipip init: can't register tunnel\n");
876 return -EAGAIN; 875 return -EAGAIN;
877 } 876 }
@@ -893,7 +892,7 @@ static int __init ipip_init(void)
893 err2: 892 err2:
894 free_netdev(ipip_fb_tunnel_dev); 893 free_netdev(ipip_fb_tunnel_dev);
895 err1: 894 err1:
896 xfrm4_tunnel_deregister(&ipip_handler); 895 xfrm4_tunnel_deregister(&ipip_handler, AF_INET);
897 goto out; 896 goto out;
898} 897}
899 898
@@ -913,7 +912,7 @@ static void __exit ipip_destroy_tunnels(void)
913 912
914static void __exit ipip_fini(void) 913static void __exit ipip_fini(void)
915{ 914{
916 if (xfrm4_tunnel_deregister(&ipip_handler)) 915 if (xfrm4_tunnel_deregister(&ipip_handler, AF_INET))
917 printk(KERN_INFO "ipip close: can't deregister tunnel\n"); 916 printk(KERN_INFO "ipip close: can't deregister tunnel\n");
918 917
919 rtnl_lock(); 918 rtnl_lock();
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index e6d11abd7841..601e3df69258 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -31,7 +31,6 @@
31#include <asm/system.h> 31#include <asm/system.h>
32#include <asm/uaccess.h> 32#include <asm/uaccess.h>
33#include <linux/types.h> 33#include <linux/types.h>
34#include <linux/sched.h>
35#include <linux/capability.h> 34#include <linux/capability.h>
36#include <linux/errno.h> 35#include <linux/errno.h>
37#include <linux/timer.h> 36#include <linux/timer.h>
diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c
index 8b08d9cdcbc8..b3050a6817e7 100644
--- a/net/ipv4/ipvs/ip_vs_ctl.c
+++ b/net/ipv4/ipvs/ip_vs_ctl.c
@@ -2359,7 +2359,7 @@ int ip_vs_control_init(void)
2359 proc_net_fops_create("ip_vs", 0, &ip_vs_info_fops); 2359 proc_net_fops_create("ip_vs", 0, &ip_vs_info_fops);
2360 proc_net_fops_create("ip_vs_stats",0, &ip_vs_stats_fops); 2360 proc_net_fops_create("ip_vs_stats",0, &ip_vs_stats_fops);
2361 2361
2362 sysctl_header = register_sysctl_table(vs_root_table, 0); 2362 sysctl_header = register_sysctl_table(vs_root_table);
2363 2363
2364 /* Initialize ip_vs_svc_table, ip_vs_svc_fwm_table, ip_vs_rtable */ 2364 /* Initialize ip_vs_svc_table, ip_vs_svc_fwm_table, ip_vs_rtable */
2365 for(idx = 0; idx < IP_VS_SVC_TAB_SIZE; idx++) { 2365 for(idx = 0; idx < IP_VS_SVC_TAB_SIZE; idx++) {
diff --git a/net/ipv4/ipvs/ip_vs_lblc.c b/net/ipv4/ipvs/ip_vs_lblc.c
index 76fd1fb91878..c801273cb881 100644
--- a/net/ipv4/ipvs/ip_vs_lblc.c
+++ b/net/ipv4/ipvs/ip_vs_lblc.c
@@ -583,7 +583,7 @@ static struct ip_vs_scheduler ip_vs_lblc_scheduler =
583static int __init ip_vs_lblc_init(void) 583static int __init ip_vs_lblc_init(void)
584{ 584{
585 INIT_LIST_HEAD(&ip_vs_lblc_scheduler.n_list); 585 INIT_LIST_HEAD(&ip_vs_lblc_scheduler.n_list);
586 sysctl_header = register_sysctl_table(lblc_root_table, 0); 586 sysctl_header = register_sysctl_table(lblc_root_table);
587 return register_ip_vs_scheduler(&ip_vs_lblc_scheduler); 587 return register_ip_vs_scheduler(&ip_vs_lblc_scheduler);
588} 588}
589 589
diff --git a/net/ipv4/ipvs/ip_vs_lblcr.c b/net/ipv4/ipvs/ip_vs_lblcr.c
index bf1e7f272b84..23f9b9e73c85 100644
--- a/net/ipv4/ipvs/ip_vs_lblcr.c
+++ b/net/ipv4/ipvs/ip_vs_lblcr.c
@@ -841,7 +841,7 @@ static struct ip_vs_scheduler ip_vs_lblcr_scheduler =
841static int __init ip_vs_lblcr_init(void) 841static int __init ip_vs_lblcr_init(void)
842{ 842{
843 INIT_LIST_HEAD(&ip_vs_lblcr_scheduler.n_list); 843 INIT_LIST_HEAD(&ip_vs_lblcr_scheduler.n_list);
844 sysctl_header = register_sysctl_table(lblcr_root_table, 0); 844 sysctl_header = register_sysctl_table(lblcr_root_table);
845#ifdef CONFIG_IP_VS_LBLCR_DEBUG 845#ifdef CONFIG_IP_VS_LBLCR_DEBUG
846 proc_net_create("ip_vs_lblcr", 0, ip_vs_lblcr_getinfo); 846 proc_net_create("ip_vs_lblcr", 0, ip_vs_lblcr_getinfo);
847#endif 847#endif
diff --git a/net/ipv4/ipvs/ip_vs_sched.c b/net/ipv4/ipvs/ip_vs_sched.c
index 8bc42b76223d..1602304abbf9 100644
--- a/net/ipv4/ipvs/ip_vs_sched.c
+++ b/net/ipv4/ipvs/ip_vs_sched.c
@@ -20,7 +20,6 @@
20 */ 20 */
21 21
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/sched.h>
24#include <linux/spinlock.h> 23#include <linux/spinlock.h>
25#include <linux/interrupt.h> 24#include <linux/interrupt.h>
26#include <asm/string.h> 25#include <asm/string.h>
diff --git a/net/ipv4/multipath_drr.c b/net/ipv4/multipath_drr.c
index cb8fce467349..574c735836fc 100644
--- a/net/ipv4/multipath_drr.c
+++ b/net/ipv4/multipath_drr.c
@@ -15,7 +15,6 @@
15#include <asm/system.h> 15#include <asm/system.h>
16#include <asm/uaccess.h> 16#include <asm/uaccess.h>
17#include <linux/types.h> 17#include <linux/types.h>
18#include <linux/sched.h>
19#include <linux/errno.h> 18#include <linux/errno.h>
20#include <linux/timer.h> 19#include <linux/timer.h>
21#include <linux/mm.h> 20#include <linux/mm.h>
diff --git a/net/ipv4/multipath_random.c b/net/ipv4/multipath_random.c
index 047e861f06bd..57f481498fbb 100644
--- a/net/ipv4/multipath_random.c
+++ b/net/ipv4/multipath_random.c
@@ -15,7 +15,6 @@
15#include <asm/system.h> 15#include <asm/system.h>
16#include <asm/uaccess.h> 16#include <asm/uaccess.h>
17#include <linux/types.h> 17#include <linux/types.h>
18#include <linux/sched.h>
19#include <linux/errno.h> 18#include <linux/errno.h>
20#include <linux/timer.h> 19#include <linux/timer.h>
21#include <linux/mm.h> 20#include <linux/mm.h>
diff --git a/net/ipv4/multipath_rr.c b/net/ipv4/multipath_rr.c
index 896246d8040e..0ad22524f450 100644
--- a/net/ipv4/multipath_rr.c
+++ b/net/ipv4/multipath_rr.c
@@ -15,7 +15,6 @@
15#include <asm/system.h> 15#include <asm/system.h>
16#include <asm/uaccess.h> 16#include <asm/uaccess.h>
17#include <linux/types.h> 17#include <linux/types.h>
18#include <linux/sched.h>
19#include <linux/errno.h> 18#include <linux/errno.h>
20#include <linux/timer.h> 19#include <linux/timer.h>
21#include <linux/mm.h> 20#include <linux/mm.h>
diff --git a/net/ipv4/multipath_wrandom.c b/net/ipv4/multipath_wrandom.c
index 7e22f15d13df..2bdbb92b450a 100644
--- a/net/ipv4/multipath_wrandom.c
+++ b/net/ipv4/multipath_wrandom.c
@@ -15,7 +15,6 @@
15#include <asm/system.h> 15#include <asm/system.h>
16#include <asm/uaccess.h> 16#include <asm/uaccess.h>
17#include <linux/types.h> 17#include <linux/types.h>
18#include <linux/sched.h>
19#include <linux/errno.h> 18#include <linux/errno.h>
20#include <linux/timer.h> 19#include <linux/timer.h>
21#include <linux/mm.h> 20#include <linux/mm.h>
diff --git a/net/ipv4/netfilter/ip_conntrack_proto_generic.c b/net/ipv4/netfilter/ip_conntrack_proto_generic.c
index 36f2b5e5d80a..88af82e98658 100644
--- a/net/ipv4/netfilter/ip_conntrack_proto_generic.c
+++ b/net/ipv4/netfilter/ip_conntrack_proto_generic.c
@@ -7,7 +7,6 @@
7 */ 7 */
8 8
9#include <linux/types.h> 9#include <linux/types.h>
10#include <linux/sched.h>
11#include <linux/timer.h> 10#include <linux/timer.h>
12#include <linux/netfilter.h> 11#include <linux/netfilter.h>
13#include <linux/netfilter_ipv4/ip_conntrack_protocol.h> 12#include <linux/netfilter_ipv4/ip_conntrack_protocol.h>
diff --git a/net/ipv4/netfilter/ip_conntrack_proto_icmp.c b/net/ipv4/netfilter/ip_conntrack_proto_icmp.c
index ec71abead00c..ad70c81a21e0 100644
--- a/net/ipv4/netfilter/ip_conntrack_proto_icmp.c
+++ b/net/ipv4/netfilter/ip_conntrack_proto_icmp.c
@@ -7,7 +7,6 @@
7 */ 7 */
8 8
9#include <linux/types.h> 9#include <linux/types.h>
10#include <linux/sched.h>
11#include <linux/timer.h> 10#include <linux/timer.h>
12#include <linux/netfilter.h> 11#include <linux/netfilter.h>
13#include <linux/in.h> 12#include <linux/in.h>
diff --git a/net/ipv4/netfilter/ip_conntrack_proto_sctp.c b/net/ipv4/netfilter/ip_conntrack_proto_sctp.c
index 9d5b917f49cd..e6942992b2f6 100644
--- a/net/ipv4/netfilter/ip_conntrack_proto_sctp.c
+++ b/net/ipv4/netfilter/ip_conntrack_proto_sctp.c
@@ -14,7 +14,6 @@
14 */ 14 */
15 15
16#include <linux/types.h> 16#include <linux/types.h>
17#include <linux/sched.h>
18#include <linux/timer.h> 17#include <linux/timer.h>
19#include <linux/interrupt.h> 18#include <linux/interrupt.h>
20#include <linux/netfilter.h> 19#include <linux/netfilter.h>
@@ -623,7 +622,7 @@ static int __init ip_conntrack_proto_sctp_init(void)
623 } 622 }
624 623
625#ifdef CONFIG_SYSCTL 624#ifdef CONFIG_SYSCTL
626 ip_ct_sysctl_header = register_sysctl_table(ip_ct_net_table, 0); 625 ip_ct_sysctl_header = register_sysctl_table(ip_ct_net_table);
627 if (ip_ct_sysctl_header == NULL) { 626 if (ip_ct_sysctl_header == NULL) {
628 ret = -ENOMEM; 627 ret = -ENOMEM;
629 printk("ip_conntrack_proto_sctp: can't register to sysctl.\n"); 628 printk("ip_conntrack_proto_sctp: can't register to sysctl.\n");
diff --git a/net/ipv4/netfilter/ip_conntrack_proto_tcp.c b/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
index fa35b49fe2fa..170d625fad67 100644
--- a/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
+++ b/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
@@ -20,7 +20,6 @@
20 */ 20 */
21 21
22#include <linux/types.h> 22#include <linux/types.h>
23#include <linux/sched.h>
24#include <linux/timer.h> 23#include <linux/timer.h>
25#include <linux/netfilter.h> 24#include <linux/netfilter.h>
26#include <linux/module.h> 25#include <linux/module.h>
diff --git a/net/ipv4/netfilter/ip_conntrack_proto_udp.c b/net/ipv4/netfilter/ip_conntrack_proto_udp.c
index a99a7c75e5b5..14c30c646c7f 100644
--- a/net/ipv4/netfilter/ip_conntrack_proto_udp.c
+++ b/net/ipv4/netfilter/ip_conntrack_proto_udp.c
@@ -7,7 +7,6 @@
7 */ 7 */
8 8
9#include <linux/types.h> 9#include <linux/types.h>
10#include <linux/sched.h>
11#include <linux/timer.h> 10#include <linux/timer.h>
12#include <linux/netfilter.h> 11#include <linux/netfilter.h>
13#include <linux/in.h> 12#include <linux/in.h>
diff --git a/net/ipv4/netfilter/ip_conntrack_standalone.c b/net/ipv4/netfilter/ip_conntrack_standalone.c
index c7c1ec61b0f5..56b2f7546d1e 100644
--- a/net/ipv4/netfilter/ip_conntrack_standalone.c
+++ b/net/ipv4/netfilter/ip_conntrack_standalone.c
@@ -848,7 +848,7 @@ static int __init ip_conntrack_standalone_init(void)
848 goto cleanup_proc_stat; 848 goto cleanup_proc_stat;
849 } 849 }
850#ifdef CONFIG_SYSCTL 850#ifdef CONFIG_SYSCTL
851 ip_ct_sysctl_header = register_sysctl_table(ip_ct_net_table, 0); 851 ip_ct_sysctl_header = register_sysctl_table(ip_ct_net_table);
852 if (ip_ct_sysctl_header == NULL) { 852 if (ip_ct_sysctl_header == NULL) {
853 printk("ip_conntrack: can't register to sysctl.\n"); 853 printk("ip_conntrack: can't register to sysctl.\n");
854 ret = -ENOMEM; 854 ret = -ENOMEM;
diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c
index 68bf19f3b01c..a14798a850d7 100644
--- a/net/ipv4/netfilter/ip_queue.c
+++ b/net/ipv4/netfilter/ip_queue.c
@@ -693,7 +693,7 @@ static int __init ip_queue_init(void)
693 } 693 }
694 694
695 register_netdevice_notifier(&ipq_dev_notifier); 695 register_netdevice_notifier(&ipq_dev_notifier);
696 ipq_sysctl_header = register_sysctl_table(ipq_root_table, 0); 696 ipq_sysctl_header = register_sysctl_table(ipq_root_table);
697 697
698 status = nf_register_queue_handler(PF_INET, &nfqh); 698 status = nf_register_queue_handler(PF_INET, &nfqh);
699 if (status < 0) { 699 if (status < 0) {
diff --git a/net/ipv4/netfilter/ipt_REJECT.c b/net/ipv4/netfilter/ipt_REJECT.c
index a9eb3635fff2..80f739e21824 100644
--- a/net/ipv4/netfilter/ipt_REJECT.c
+++ b/net/ipv4/netfilter/ipt_REJECT.c
@@ -80,6 +80,10 @@ static void send_reset(struct sk_buff *oldskb, int hook)
80 nskb->mark = 0; 80 nskb->mark = 0;
81 skb_init_secmark(nskb); 81 skb_init_secmark(nskb);
82 82
83 skb_shinfo(nskb)->gso_size = 0;
84 skb_shinfo(nskb)->gso_segs = 0;
85 skb_shinfo(nskb)->gso_type = 0;
86
83 tcph = (struct tcphdr *)((u_int32_t*)nskb->nh.iph + nskb->nh.iph->ihl); 87 tcph = (struct tcphdr *)((u_int32_t*)nskb->nh.iph + nskb->nh.iph->ihl);
84 88
85 /* Swap source and dest */ 89 /* Swap source and dest */
diff --git a/net/ipv4/netfilter/nf_conntrack_proto_icmp.c b/net/ipv4/netfilter/nf_conntrack_proto_icmp.c
index e5aa4d849b00..88cfa6aacfc1 100644
--- a/net/ipv4/netfilter/nf_conntrack_proto_icmp.c
+++ b/net/ipv4/netfilter/nf_conntrack_proto_icmp.c
@@ -12,7 +12,6 @@
12 */ 12 */
13 13
14#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/sched.h>
16#include <linux/timer.h> 15#include <linux/timer.h>
17#include <linux/netfilter.h> 16#include <linux/netfilter.h>
18#include <linux/in.h> 17#include <linux/in.h>
diff --git a/net/ipv4/protocol.c b/net/ipv4/protocol.c
index 6cd6340de8bd..da70fef82c93 100644
--- a/net/ipv4/protocol.c
+++ b/net/ipv4/protocol.c
@@ -30,7 +30,6 @@
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/types.h> 31#include <linux/types.h>
32#include <linux/kernel.h> 32#include <linux/kernel.h>
33#include <linux/sched.h>
34#include <linux/string.h> 33#include <linux/string.h>
35#include <linux/socket.h> 34#include <linux/socket.h>
36#include <linux/in.h> 35#include <linux/in.h>
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 9b5e56481d53..37e0d4d5cf94 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -70,7 +70,6 @@
70#include <linux/bitops.h> 70#include <linux/bitops.h>
71#include <linux/types.h> 71#include <linux/types.h>
72#include <linux/kernel.h> 72#include <linux/kernel.h>
73#include <linux/sched.h>
74#include <linux/mm.h> 73#include <linux/mm.h>
75#include <linux/bootmem.h> 74#include <linux/bootmem.h>
76#include <linux/string.h> 75#include <linux/string.h>
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index cebe9aa918a3..dc151139b5af 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -481,7 +481,7 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it,
481 /* RFC1323: The window in SYN & SYN/ACK segments 481 /* RFC1323: The window in SYN & SYN/ACK segments
482 * is never scaled. 482 * is never scaled.
483 */ 483 */
484 th->window = htons(tp->rcv_wnd); 484 th->window = htons(min(tp->rcv_wnd, 65535U));
485 } else { 485 } else {
486 th->window = htons(tcp_select_window(sk)); 486 th->window = htons(tcp_select_window(sk));
487 } 487 }
@@ -2160,7 +2160,7 @@ struct sk_buff * tcp_make_synack(struct sock *sk, struct dst_entry *dst,
2160 } 2160 }
2161 2161
2162 /* RFC1323: The window in SYN & SYN/ACK segments is never scaled. */ 2162 /* RFC1323: The window in SYN & SYN/ACK segments is never scaled. */
2163 th->window = htons(req->rcv_wnd); 2163 th->window = htons(min(req->rcv_wnd, 65535U));
2164 2164
2165 TCP_SKB_CB(skb)->when = tcp_time_stamp; 2165 TCP_SKB_CB(skb)->when = tcp_time_stamp;
2166 tcp_syn_build_options((__be32 *)(th + 1), dst_metric(dst, RTAX_ADVMSS), ireq->tstamp_ok, 2166 tcp_syn_build_options((__be32 *)(th + 1), dst_metric(dst, RTAX_ADVMSS), ireq->tstamp_ok,
diff --git a/net/ipv4/tunnel4.c b/net/ipv4/tunnel4.c
index 8d30c48f090e..a794a8ca8b4f 100644
--- a/net/ipv4/tunnel4.c
+++ b/net/ipv4/tunnel4.c
@@ -14,9 +14,10 @@
14#include <net/xfrm.h> 14#include <net/xfrm.h>
15 15
16static struct xfrm_tunnel *tunnel4_handlers; 16static struct xfrm_tunnel *tunnel4_handlers;
17static struct xfrm_tunnel *tunnel64_handlers;
17static DEFINE_MUTEX(tunnel4_mutex); 18static DEFINE_MUTEX(tunnel4_mutex);
18 19
19int xfrm4_tunnel_register(struct xfrm_tunnel *handler) 20int xfrm4_tunnel_register(struct xfrm_tunnel *handler, unsigned short family)
20{ 21{
21 struct xfrm_tunnel **pprev; 22 struct xfrm_tunnel **pprev;
22 int ret = -EEXIST; 23 int ret = -EEXIST;
@@ -24,7 +25,8 @@ int xfrm4_tunnel_register(struct xfrm_tunnel *handler)
24 25
25 mutex_lock(&tunnel4_mutex); 26 mutex_lock(&tunnel4_mutex);
26 27
27 for (pprev = &tunnel4_handlers; *pprev; pprev = &(*pprev)->next) { 28 for (pprev = (family == AF_INET) ? &tunnel4_handlers : &tunnel64_handlers;
29 *pprev; pprev = &(*pprev)->next) {
28 if ((*pprev)->priority > priority) 30 if ((*pprev)->priority > priority)
29 break; 31 break;
30 if ((*pprev)->priority == priority) 32 if ((*pprev)->priority == priority)
@@ -44,14 +46,15 @@ err:
44 46
45EXPORT_SYMBOL(xfrm4_tunnel_register); 47EXPORT_SYMBOL(xfrm4_tunnel_register);
46 48
47int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler) 49int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler, unsigned short family)
48{ 50{
49 struct xfrm_tunnel **pprev; 51 struct xfrm_tunnel **pprev;
50 int ret = -ENOENT; 52 int ret = -ENOENT;
51 53
52 mutex_lock(&tunnel4_mutex); 54 mutex_lock(&tunnel4_mutex);
53 55
54 for (pprev = &tunnel4_handlers; *pprev; pprev = &(*pprev)->next) { 56 for (pprev = (family == AF_INET) ? &tunnel4_handlers : &tunnel64_handlers;
57 *pprev; pprev = &(*pprev)->next) {
55 if (*pprev == handler) { 58 if (*pprev == handler) {
56 *pprev = handler->next; 59 *pprev = handler->next;
57 ret = 0; 60 ret = 0;
@@ -86,6 +89,26 @@ drop:
86 return 0; 89 return 0;
87} 90}
88 91
92#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
93static int tunnel64_rcv(struct sk_buff *skb)
94{
95 struct xfrm_tunnel *handler;
96
97 if (!pskb_may_pull(skb, sizeof(struct iphdr)))
98 goto drop;
99
100 for (handler = tunnel64_handlers; handler; handler = handler->next)
101 if (!handler->handler(skb))
102 return 0;
103
104 icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0);
105
106drop:
107 kfree_skb(skb);
108 return 0;
109}
110#endif
111
89static void tunnel4_err(struct sk_buff *skb, u32 info) 112static void tunnel4_err(struct sk_buff *skb, u32 info)
90{ 113{
91 struct xfrm_tunnel *handler; 114 struct xfrm_tunnel *handler;
@@ -101,17 +124,36 @@ static struct net_protocol tunnel4_protocol = {
101 .no_policy = 1, 124 .no_policy = 1,
102}; 125};
103 126
127#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
128static struct net_protocol tunnel64_protocol = {
129 .handler = tunnel64_rcv,
130 .err_handler = tunnel4_err,
131 .no_policy = 1,
132};
133#endif
134
104static int __init tunnel4_init(void) 135static int __init tunnel4_init(void)
105{ 136{
106 if (inet_add_protocol(&tunnel4_protocol, IPPROTO_IPIP)) { 137 if (inet_add_protocol(&tunnel4_protocol, IPPROTO_IPIP)) {
107 printk(KERN_ERR "tunnel4 init: can't add protocol\n"); 138 printk(KERN_ERR "tunnel4 init: can't add protocol\n");
108 return -EAGAIN; 139 return -EAGAIN;
109 } 140 }
141#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
142 if (inet_add_protocol(&tunnel64_protocol, IPPROTO_IPV6)) {
143 printk(KERN_ERR "tunnel64 init: can't add protocol\n");
144 inet_del_protocol(&tunnel4_protocol, IPPROTO_IPIP);
145 return -EAGAIN;
146 }
147#endif
110 return 0; 148 return 0;
111} 149}
112 150
113static void __exit tunnel4_fini(void) 151static void __exit tunnel4_fini(void)
114{ 152{
153#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
154 if (inet_del_protocol(&tunnel64_protocol, IPPROTO_IPV6))
155 printk(KERN_ERR "tunnel64 close: can't remove protocol\n");
156#endif
115 if (inet_del_protocol(&tunnel4_protocol, IPPROTO_IPIP)) 157 if (inet_del_protocol(&tunnel4_protocol, IPPROTO_IPIP))
116 printk(KERN_ERR "tunnel4 close: can't remove protocol\n"); 158 printk(KERN_ERR "tunnel4 close: can't remove protocol\n");
117} 159}
diff --git a/net/ipv4/xfrm4_input.c b/net/ipv4/xfrm4_input.c
index 289146bdb8b0..78e80deb7e89 100644
--- a/net/ipv4/xfrm4_input.c
+++ b/net/ipv4/xfrm4_input.c
@@ -27,6 +27,7 @@ static int xfrm4_parse_spi(struct sk_buff *skb, u8 nexthdr, __be32 *spi, __be32
27{ 27{
28 switch (nexthdr) { 28 switch (nexthdr) {
29 case IPPROTO_IPIP: 29 case IPPROTO_IPIP:
30 case IPPROTO_IPV6:
30 *spi = skb->nh.iph->saddr; 31 *spi = skb->nh.iph->saddr;
31 *seq = 0; 32 *seq = 0;
32 return 0; 33 return 0;
@@ -70,7 +71,8 @@ int xfrm4_rcv_encap(struct sk_buff *skb, __u16 encap_type)
70 if (xfrm_nr == XFRM_MAX_DEPTH) 71 if (xfrm_nr == XFRM_MAX_DEPTH)
71 goto drop; 72 goto drop;
72 73
73 x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, spi, iph->protocol, AF_INET); 74 x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, spi,
75 iph->protocol != IPPROTO_IPV6 ? iph->protocol : IPPROTO_IPIP, AF_INET);
74 if (x == NULL) 76 if (x == NULL)
75 goto drop; 77 goto drop;
76 78
diff --git a/net/ipv4/xfrm4_mode_tunnel.c b/net/ipv4/xfrm4_mode_tunnel.c
index e54c5494c88f..e1cab33fdad1 100644
--- a/net/ipv4/xfrm4_mode_tunnel.c
+++ b/net/ipv4/xfrm4_mode_tunnel.c
@@ -95,6 +95,7 @@ static int xfrm4_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
95 95
96 switch(iph->protocol){ 96 switch(iph->protocol){
97 case IPPROTO_IPIP: 97 case IPPROTO_IPIP:
98 break;
98#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) 99#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
99 case IPPROTO_IPV6: 100 case IPPROTO_IPV6:
100 break; 101 break;
diff --git a/net/ipv4/xfrm4_tunnel.c b/net/ipv4/xfrm4_tunnel.c
index 1be6762b2d47..3eef06454da9 100644
--- a/net/ipv4/xfrm4_tunnel.c
+++ b/net/ipv4/xfrm4_tunnel.c
@@ -64,24 +64,45 @@ static struct xfrm_tunnel xfrm_tunnel_handler = {
64 .priority = 2, 64 .priority = 2,
65}; 65};
66 66
67#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
68static struct xfrm_tunnel xfrm64_tunnel_handler = {
69 .handler = xfrm4_rcv,
70 .err_handler = xfrm_tunnel_err,
71 .priority = 2,
72};
73#endif
74
67static int __init ipip_init(void) 75static int __init ipip_init(void)
68{ 76{
69 if (xfrm_register_type(&ipip_type, AF_INET) < 0) { 77 if (xfrm_register_type(&ipip_type, AF_INET) < 0) {
70 printk(KERN_INFO "ipip init: can't add xfrm type\n"); 78 printk(KERN_INFO "ipip init: can't add xfrm type\n");
71 return -EAGAIN; 79 return -EAGAIN;
72 } 80 }
73 if (xfrm4_tunnel_register(&xfrm_tunnel_handler)) { 81
74 printk(KERN_INFO "ipip init: can't add xfrm handler\n"); 82 if (xfrm4_tunnel_register(&xfrm_tunnel_handler, AF_INET)) {
83 printk(KERN_INFO "ipip init: can't add xfrm handler for AF_INET\n");
84 xfrm_unregister_type(&ipip_type, AF_INET);
85 return -EAGAIN;
86 }
87#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
88 if (xfrm4_tunnel_register(&xfrm64_tunnel_handler, AF_INET6)) {
89 printk(KERN_INFO "ipip init: can't add xfrm handler for AF_INET6\n");
90 xfrm4_tunnel_deregister(&xfrm_tunnel_handler, AF_INET);
75 xfrm_unregister_type(&ipip_type, AF_INET); 91 xfrm_unregister_type(&ipip_type, AF_INET);
76 return -EAGAIN; 92 return -EAGAIN;
77 } 93 }
94#endif
78 return 0; 95 return 0;
79} 96}
80 97
81static void __exit ipip_fini(void) 98static void __exit ipip_fini(void)
82{ 99{
83 if (xfrm4_tunnel_deregister(&xfrm_tunnel_handler)) 100#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
84 printk(KERN_INFO "ipip close: can't remove xfrm handler\n"); 101 if (xfrm4_tunnel_deregister(&xfrm64_tunnel_handler, AF_INET6))
102 printk(KERN_INFO "ipip close: can't remove xfrm handler for AF_INET6\n");
103#endif
104 if (xfrm4_tunnel_deregister(&xfrm_tunnel_handler, AF_INET))
105 printk(KERN_INFO "ipip close: can't remove xfrm handler for AF_INET\n");
85 if (xfrm_unregister_type(&ipip_type, AF_INET) < 0) 106 if (xfrm_unregister_type(&ipip_type, AF_INET) < 0)
86 printk(KERN_INFO "ipip close: can't remove xfrm type\n"); 107 printk(KERN_INFO "ipip close: can't remove xfrm type\n");
87} 108}
diff --git a/net/ipv6/Kconfig b/net/ipv6/Kconfig
index deb4101a2a81..79682efb14be 100644
--- a/net/ipv6/Kconfig
+++ b/net/ipv6/Kconfig
@@ -156,6 +156,7 @@ config INET6_XFRM_MODE_ROUTEOPTIMIZATION
156config IPV6_SIT 156config IPV6_SIT
157 tristate "IPv6: IPv6-in-IPv4 tunnel (SIT driver)" 157 tristate "IPv6: IPv6-in-IPv4 tunnel (SIT driver)"
158 depends on IPV6 158 depends on IPV6
159 select INET_TUNNEL
159 default y 160 default y
160 ---help--- 161 ---help---
161 Tunneling means encapsulating data of one protocol type within 162 Tunneling means encapsulating data of one protocol type within
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index ea0755b09033..569a37d698f7 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -44,7 +44,6 @@
44#include <linux/types.h> 44#include <linux/types.h>
45#include <linux/socket.h> 45#include <linux/socket.h>
46#include <linux/sockios.h> 46#include <linux/sockios.h>
47#include <linux/sched.h>
48#include <linux/net.h> 47#include <linux/net.h>
49#include <linux/in6.h> 48#include <linux/in6.h>
50#include <linux/netdevice.h> 49#include <linux/netdevice.h>
@@ -3999,7 +3998,6 @@ static void addrconf_sysctl_register(struct inet6_dev *idev, struct ipv6_devconf
3999 return; 3998 return;
4000 for (i=0; t->addrconf_vars[i].data; i++) { 3999 for (i=0; t->addrconf_vars[i].data; i++) {
4001 t->addrconf_vars[i].data += (char*)p - (char*)&ipv6_devconf; 4000 t->addrconf_vars[i].data += (char*)p - (char*)&ipv6_devconf;
4002 t->addrconf_vars[i].de = NULL;
4003 t->addrconf_vars[i].extra1 = idev; /* embedded; no ref */ 4001 t->addrconf_vars[i].extra1 = idev; /* embedded; no ref */
4004 } 4002 }
4005 if (dev) { 4003 if (dev) {
@@ -4022,15 +4020,11 @@ static void addrconf_sysctl_register(struct inet6_dev *idev, struct ipv6_devconf
4022 t->addrconf_dev[0].procname = dev_name; 4020 t->addrconf_dev[0].procname = dev_name;
4023 4021
4024 t->addrconf_dev[0].child = t->addrconf_vars; 4022 t->addrconf_dev[0].child = t->addrconf_vars;
4025 t->addrconf_dev[0].de = NULL;
4026 t->addrconf_conf_dir[0].child = t->addrconf_dev; 4023 t->addrconf_conf_dir[0].child = t->addrconf_dev;
4027 t->addrconf_conf_dir[0].de = NULL;
4028 t->addrconf_proto_dir[0].child = t->addrconf_conf_dir; 4024 t->addrconf_proto_dir[0].child = t->addrconf_conf_dir;
4029 t->addrconf_proto_dir[0].de = NULL;
4030 t->addrconf_root_dir[0].child = t->addrconf_proto_dir; 4025 t->addrconf_root_dir[0].child = t->addrconf_proto_dir;
4031 t->addrconf_root_dir[0].de = NULL;
4032 4026
4033 t->sysctl_header = register_sysctl_table(t->addrconf_root_dir, 0); 4027 t->sysctl_header = register_sysctl_table(t->addrconf_root_dir);
4034 if (t->sysctl_header == NULL) 4028 if (t->sysctl_header == NULL)
4035 goto free_procname; 4029 goto free_procname;
4036 else 4030 else
@@ -4115,7 +4109,7 @@ int __init addrconf_init(void)
4115 rtnetlink_links[PF_INET6] = inet6_rtnetlink_table; 4109 rtnetlink_links[PF_INET6] = inet6_rtnetlink_table;
4116#ifdef CONFIG_SYSCTL 4110#ifdef CONFIG_SYSCTL
4117 addrconf_sysctl.sysctl_header = 4111 addrconf_sysctl.sysctl_header =
4118 register_sysctl_table(addrconf_sysctl.addrconf_root_dir, 0); 4112 register_sysctl_table(addrconf_sysctl.addrconf_root_dir);
4119 addrconf_sysctl_register(NULL, &ipv6_devconf_dflt); 4113 addrconf_sysctl_register(NULL, &ipv6_devconf_dflt);
4120#endif 4114#endif
4121 4115
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index a006d242be76..3585d8fa7f02 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -28,7 +28,6 @@
28#include <linux/socket.h> 28#include <linux/socket.h>
29#include <linux/in.h> 29#include <linux/in.h>
30#include <linux/kernel.h> 30#include <linux/kernel.h>
31#include <linux/sched.h>
32#include <linux/timer.h> 31#include <linux/timer.h>
33#include <linux/string.h> 32#include <linux/string.h>
34#include <linux/sockios.h> 33#include <linux/sockios.h>
diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c
index 6fb2e9d716c0..e5ef5979ade4 100644
--- a/net/ipv6/anycast.c
+++ b/net/ipv6/anycast.c
@@ -21,7 +21,6 @@
21#include <linux/string.h> 21#include <linux/string.h>
22#include <linux/socket.h> 22#include <linux/socket.h>
23#include <linux/sockios.h> 23#include <linux/sockios.h>
24#include <linux/sched.h>
25#include <linux/net.h> 24#include <linux/net.h>
26#include <linux/in6.h> 25#include <linux/in6.h>
27#include <linux/netdevice.h> 26#include <linux/netdevice.h>
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
index 5f54dec3e205..3b4e8dcf4c86 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -17,7 +17,6 @@
17#include <linux/errno.h> 17#include <linux/errno.h>
18#include <linux/types.h> 18#include <linux/types.h>
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/sched.h>
21#include <linux/interrupt.h> 20#include <linux/interrupt.h>
22#include <linux/socket.h> 21#include <linux/socket.h>
23#include <linux/sockios.h> 22#include <linux/sockios.h>
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
index 08313efc48c8..28e0c6568272 100644
--- a/net/ipv6/exthdrs.c
+++ b/net/ipv6/exthdrs.c
@@ -27,7 +27,6 @@
27#include <linux/types.h> 27#include <linux/types.h>
28#include <linux/socket.h> 28#include <linux/socket.h>
29#include <linux/sockios.h> 29#include <linux/sockios.h>
30#include <linux/sched.h>
31#include <linux/net.h> 30#include <linux/net.h>
32#include <linux/netdevice.h> 31#include <linux/netdevice.h>
33#include <linux/in6.h> 32#include <linux/in6.h>
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 9377fea02682..edfe98bf64c3 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -37,7 +37,6 @@
37#include <linux/socket.h> 37#include <linux/socket.h>
38#include <linux/in.h> 38#include <linux/in.h>
39#include <linux/kernel.h> 39#include <linux/kernel.h>
40#include <linux/sched.h>
41#include <linux/sockios.h> 40#include <linux/sockios.h>
42#include <linux/net.h> 41#include <linux/net.h>
43#include <linux/skbuff.h> 42#include <linux/skbuff.h>
diff --git a/net/ipv6/inet6_hashtables.c b/net/ipv6/inet6_hashtables.c
index 30b16da739c2..ae6b0e7eb488 100644
--- a/net/ipv6/inet6_hashtables.c
+++ b/net/ipv6/inet6_hashtables.c
@@ -172,7 +172,7 @@ static int __inet6_check_established(struct inet_timewait_death_row *death_row,
172 const struct in6_addr *saddr = &np->daddr; 172 const struct in6_addr *saddr = &np->daddr;
173 const int dif = sk->sk_bound_dev_if; 173 const int dif = sk->sk_bound_dev_if;
174 const __portpair ports = INET_COMBINED_PORTS(inet->dport, lport); 174 const __portpair ports = INET_COMBINED_PORTS(inet->dport, lport);
175 const unsigned int hash = inet6_ehashfn(daddr, inet->num, saddr, 175 const unsigned int hash = inet6_ehashfn(daddr, lport, saddr,
176 inet->dport); 176 inet->dport);
177 struct inet_ehash_bucket *head = inet_ehash_bucket(hinfo, hash); 177 struct inet_ehash_bucket *head = inet_ehash_bucket(hinfo, hash);
178 struct sock *sk2; 178 struct sock *sk2;
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
index 4fdded0e545a..11bfc7c43182 100644
--- a/net/ipv6/ip6_input.c
+++ b/net/ipv6/ip6_input.c
@@ -25,7 +25,6 @@
25#include <linux/types.h> 25#include <linux/types.h>
26#include <linux/socket.h> 26#include <linux/socket.h>
27#include <linux/sockios.h> 27#include <linux/sockios.h>
28#include <linux/sched.h>
29#include <linux/net.h> 28#include <linux/net.h>
30#include <linux/netdevice.h> 29#include <linux/netdevice.h>
31#include <linux/in6.h> 30#include <linux/in6.h>
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 367b74832986..662edb826899 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -1128,7 +1128,7 @@ static int __init ip6_tunnel_init(void)
1128{ 1128{
1129 int err; 1129 int err;
1130 1130
1131 if (xfrm6_tunnel_register(&ip6ip6_handler)) { 1131 if (xfrm6_tunnel_register(&ip6ip6_handler, AF_INET6)) {
1132 printk(KERN_ERR "ip6ip6 init: can't register tunnel\n"); 1132 printk(KERN_ERR "ip6ip6 init: can't register tunnel\n");
1133 return -EAGAIN; 1133 return -EAGAIN;
1134 } 1134 }
@@ -1147,7 +1147,7 @@ static int __init ip6_tunnel_init(void)
1147 } 1147 }
1148 return 0; 1148 return 0;
1149fail: 1149fail:
1150 xfrm6_tunnel_deregister(&ip6ip6_handler); 1150 xfrm6_tunnel_deregister(&ip6ip6_handler, AF_INET6);
1151 return err; 1151 return err;
1152} 1152}
1153 1153
@@ -1171,7 +1171,7 @@ static void __exit ip6ip6_destroy_tunnels(void)
1171 1171
1172static void __exit ip6_tunnel_cleanup(void) 1172static void __exit ip6_tunnel_cleanup(void)
1173{ 1173{
1174 if (xfrm6_tunnel_deregister(&ip6ip6_handler)) 1174 if (xfrm6_tunnel_deregister(&ip6ip6_handler, AF_INET6))
1175 printk(KERN_INFO "ip6ip6 close: can't deregister tunnel\n"); 1175 printk(KERN_INFO "ip6ip6 close: can't deregister tunnel\n");
1176 1176
1177 rtnl_lock(); 1177 rtnl_lock();
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 3f1e779ea5c5..286c86735aed 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -31,7 +31,6 @@
31#include <linux/types.h> 31#include <linux/types.h>
32#include <linux/socket.h> 32#include <linux/socket.h>
33#include <linux/sockios.h> 33#include <linux/sockios.h>
34#include <linux/sched.h>
35#include <linux/net.h> 34#include <linux/net.h>
36#include <linux/in6.h> 35#include <linux/in6.h>
37#include <linux/netdevice.h> 36#include <linux/netdevice.h>
diff --git a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c
index 58847d3b61e5..fdb30a5916e5 100644
--- a/net/ipv6/netfilter/ip6_queue.c
+++ b/net/ipv6/netfilter/ip6_queue.c
@@ -683,7 +683,7 @@ static int __init ip6_queue_init(void)
683 } 683 }
684 684
685 register_netdevice_notifier(&ipq_dev_notifier); 685 register_netdevice_notifier(&ipq_dev_notifier);
686 ipq_sysctl_header = register_sysctl_table(ipq_root_table, 0); 686 ipq_sysctl_header = register_sysctl_table(ipq_root_table);
687 687
688 status = nf_register_queue_handler(PF_INET6, &nfqh); 688 status = nf_register_queue_handler(PF_INET6, &nfqh);
689 if (status < 0) { 689 if (status < 0) {
diff --git a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
index 19bdb7cb8ff3..21f19cc719f3 100644
--- a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
+++ b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
@@ -17,7 +17,6 @@
17 */ 17 */
18 18
19#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/sched.h>
21#include <linux/timer.h> 20#include <linux/timer.h>
22#include <linux/module.h> 21#include <linux/module.h>
23#include <linux/netfilter.h> 22#include <linux/netfilter.h>
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index c82257dd04b6..fa3fb509f187 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -17,7 +17,6 @@
17 * as published by the Free Software Foundation; either version 17 * as published by the Free Software Foundation; either version
18 * 2 of the License, or (at your option) any later version. 18 * 2 of the License, or (at your option) any later version.
19 */ 19 */
20#include <linux/sched.h>
21#include <linux/socket.h> 20#include <linux/socket.h>
22#include <linux/net.h> 21#include <linux/net.h>
23#include <linux/ipv6.h> 22#include <linux/ipv6.h>
diff --git a/net/ipv6/protocol.c b/net/ipv6/protocol.c
index ad0410c99675..ef43bd57baed 100644
--- a/net/ipv6/protocol.c
+++ b/net/ipv6/protocol.c
@@ -27,7 +27,6 @@
27#include <linux/types.h> 27#include <linux/types.h>
28#include <linux/socket.h> 28#include <linux/socket.h>
29#include <linux/sockios.h> 29#include <linux/sockios.h>
30#include <linux/sched.h>
31#include <linux/net.h> 30#include <linux/net.h>
32#include <linux/in6.h> 31#include <linux/in6.h>
33#include <linux/netdevice.h> 32#include <linux/netdevice.h>
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 1f8f6275a7e4..306d5d83c068 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -24,7 +24,6 @@
24#include <linux/types.h> 24#include <linux/types.h>
25#include <linux/socket.h> 25#include <linux/socket.h>
26#include <linux/sockios.h> 26#include <linux/sockios.h>
27#include <linux/sched.h>
28#include <linux/net.h> 27#include <linux/net.h>
29#include <linux/in6.h> 28#include <linux/in6.h>
30#include <linux/netdevice.h> 29#include <linux/netdevice.h>
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 4d3cf301e1fc..08d6ed3396e4 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -24,7 +24,6 @@
24#include <linux/types.h> 24#include <linux/types.h>
25#include <linux/socket.h> 25#include <linux/socket.h>
26#include <linux/sockios.h> 26#include <linux/sockios.h>
27#include <linux/sched.h>
28#include <linux/net.h> 27#include <linux/net.h>
29#include <linux/in6.h> 28#include <linux/in6.h>
30#include <linux/netdevice.h> 29#include <linux/netdevice.h>
@@ -216,7 +215,7 @@ static void ipip6_tunnel_uninit(struct net_device *dev)
216} 215}
217 216
218 217
219static void ipip6_err(struct sk_buff *skb, u32 info) 218static int ipip6_err(struct sk_buff *skb, u32 info)
220{ 219{
221#ifndef I_WISH_WORLD_WERE_PERFECT 220#ifndef I_WISH_WORLD_WERE_PERFECT
222 221
@@ -228,21 +227,22 @@ static void ipip6_err(struct sk_buff *skb, u32 info)
228 int type = skb->h.icmph->type; 227 int type = skb->h.icmph->type;
229 int code = skb->h.icmph->code; 228 int code = skb->h.icmph->code;
230 struct ip_tunnel *t; 229 struct ip_tunnel *t;
230 int err;
231 231
232 switch (type) { 232 switch (type) {
233 default: 233 default:
234 case ICMP_PARAMETERPROB: 234 case ICMP_PARAMETERPROB:
235 return; 235 return 0;
236 236
237 case ICMP_DEST_UNREACH: 237 case ICMP_DEST_UNREACH:
238 switch (code) { 238 switch (code) {
239 case ICMP_SR_FAILED: 239 case ICMP_SR_FAILED:
240 case ICMP_PORT_UNREACH: 240 case ICMP_PORT_UNREACH:
241 /* Impossible event. */ 241 /* Impossible event. */
242 return; 242 return 0;
243 case ICMP_FRAG_NEEDED: 243 case ICMP_FRAG_NEEDED:
244 /* Soft state for pmtu is maintained by IP core. */ 244 /* Soft state for pmtu is maintained by IP core. */
245 return; 245 return 0;
246 default: 246 default:
247 /* All others are translated to HOST_UNREACH. 247 /* All others are translated to HOST_UNREACH.
248 rfc2003 contains "deep thoughts" about NET_UNREACH, 248 rfc2003 contains "deep thoughts" about NET_UNREACH,
@@ -253,14 +253,18 @@ static void ipip6_err(struct sk_buff *skb, u32 info)
253 break; 253 break;
254 case ICMP_TIME_EXCEEDED: 254 case ICMP_TIME_EXCEEDED:
255 if (code != ICMP_EXC_TTL) 255 if (code != ICMP_EXC_TTL)
256 return; 256 return 0;
257 break; 257 break;
258 } 258 }
259 259
260 err = -ENOENT;
261
260 read_lock(&ipip6_lock); 262 read_lock(&ipip6_lock);
261 t = ipip6_tunnel_lookup(iph->daddr, iph->saddr); 263 t = ipip6_tunnel_lookup(iph->daddr, iph->saddr);
262 if (t == NULL || t->parms.iph.daddr == 0) 264 if (t == NULL || t->parms.iph.daddr == 0)
263 goto out; 265 goto out;
266
267 err = 0;
264 if (t->parms.iph.ttl == 0 && type == ICMP_TIME_EXCEEDED) 268 if (t->parms.iph.ttl == 0 && type == ICMP_TIME_EXCEEDED)
265 goto out; 269 goto out;
266 270
@@ -271,7 +275,7 @@ static void ipip6_err(struct sk_buff *skb, u32 info)
271 t->err_time = jiffies; 275 t->err_time = jiffies;
272out: 276out:
273 read_unlock(&ipip6_lock); 277 read_unlock(&ipip6_lock);
274 return; 278 return err;
275#else 279#else
276 struct iphdr *iph = (struct iphdr*)dp; 280 struct iphdr *iph = (struct iphdr*)dp;
277 int hlen = iph->ihl<<2; 281 int hlen = iph->ihl<<2;
@@ -332,7 +336,7 @@ out:
332 /* Prepare fake skb to feed it to icmpv6_send */ 336 /* Prepare fake skb to feed it to icmpv6_send */
333 skb2 = skb_clone(skb, GFP_ATOMIC); 337 skb2 = skb_clone(skb, GFP_ATOMIC);
334 if (skb2 == NULL) 338 if (skb2 == NULL)
335 return; 339 return 0;
336 dst_release(skb2->dst); 340 dst_release(skb2->dst);
337 skb2->dst = NULL; 341 skb2->dst = NULL;
338 skb_pull(skb2, skb->data - (u8*)iph6); 342 skb_pull(skb2, skb->data - (u8*)iph6);
@@ -355,7 +359,7 @@ out:
355 } 359 }
356 } 360 }
357 kfree_skb(skb2); 361 kfree_skb(skb2);
358 return; 362 return 0;
359#endif 363#endif
360} 364}
361 365
@@ -791,9 +795,10 @@ static int __init ipip6_fb_tunnel_init(struct net_device *dev)
791 return 0; 795 return 0;
792} 796}
793 797
794static struct net_protocol sit_protocol = { 798static struct xfrm_tunnel sit_handler = {
795 .handler = ipip6_rcv, 799 .handler = ipip6_rcv,
796 .err_handler = ipip6_err, 800 .err_handler = ipip6_err,
801 .priority = 1,
797}; 802};
798 803
799static void __exit sit_destroy_tunnels(void) 804static void __exit sit_destroy_tunnels(void)
@@ -812,7 +817,7 @@ static void __exit sit_destroy_tunnels(void)
812 817
813static void __exit sit_cleanup(void) 818static void __exit sit_cleanup(void)
814{ 819{
815 inet_del_protocol(&sit_protocol, IPPROTO_IPV6); 820 xfrm4_tunnel_deregister(&sit_handler, AF_INET6);
816 821
817 rtnl_lock(); 822 rtnl_lock();
818 sit_destroy_tunnels(); 823 sit_destroy_tunnels();
@@ -826,7 +831,7 @@ static int __init sit_init(void)
826 831
827 printk(KERN_INFO "IPv6 over IPv4 tunneling driver\n"); 832 printk(KERN_INFO "IPv6 over IPv4 tunneling driver\n");
828 833
829 if (inet_add_protocol(&sit_protocol, IPPROTO_IPV6) < 0) { 834 if (xfrm4_tunnel_register(&sit_handler, AF_INET6) < 0) {
830 printk(KERN_INFO "sit init: Can't add protocol\n"); 835 printk(KERN_INFO "sit init: Can't add protocol\n");
831 return -EAGAIN; 836 return -EAGAIN;
832 } 837 }
@@ -848,7 +853,7 @@ static int __init sit_init(void)
848 err2: 853 err2:
849 free_netdev(ipip6_fb_tunnel_dev); 854 free_netdev(ipip6_fb_tunnel_dev);
850 err1: 855 err1:
851 inet_del_protocol(&sit_protocol, IPPROTO_IPV6); 856 xfrm4_tunnel_deregister(&sit_handler, AF_INET6);
852 goto out; 857 goto out;
853} 858}
854 859
diff --git a/net/ipv6/sysctl_net_ipv6.c b/net/ipv6/sysctl_net_ipv6.c
index 25e8e7783fee..3fb44277207b 100644
--- a/net/ipv6/sysctl_net_ipv6.c
+++ b/net/ipv6/sysctl_net_ipv6.c
@@ -107,7 +107,7 @@ static ctl_table ipv6_root_table[] = {
107 107
108void ipv6_sysctl_register(void) 108void ipv6_sysctl_register(void)
109{ 109{
110 ipv6_sysctl_header = register_sysctl_table(ipv6_root_table, 0); 110 ipv6_sysctl_header = register_sysctl_table(ipv6_root_table);
111} 111}
112 112
113void ipv6_sysctl_unregister(void) 113void ipv6_sysctl_unregister(void)
diff --git a/net/ipv6/tunnel6.c b/net/ipv6/tunnel6.c
index 918d07dd1219..23e2809878ae 100644
--- a/net/ipv6/tunnel6.c
+++ b/net/ipv6/tunnel6.c
@@ -30,9 +30,10 @@
30#include <net/xfrm.h> 30#include <net/xfrm.h>
31 31
32static struct xfrm6_tunnel *tunnel6_handlers; 32static struct xfrm6_tunnel *tunnel6_handlers;
33static struct xfrm6_tunnel *tunnel46_handlers;
33static DEFINE_MUTEX(tunnel6_mutex); 34static DEFINE_MUTEX(tunnel6_mutex);
34 35
35int xfrm6_tunnel_register(struct xfrm6_tunnel *handler) 36int xfrm6_tunnel_register(struct xfrm6_tunnel *handler, unsigned short family)
36{ 37{
37 struct xfrm6_tunnel **pprev; 38 struct xfrm6_tunnel **pprev;
38 int ret = -EEXIST; 39 int ret = -EEXIST;
@@ -40,7 +41,8 @@ int xfrm6_tunnel_register(struct xfrm6_tunnel *handler)
40 41
41 mutex_lock(&tunnel6_mutex); 42 mutex_lock(&tunnel6_mutex);
42 43
43 for (pprev = &tunnel6_handlers; *pprev; pprev = &(*pprev)->next) { 44 for (pprev = (family == AF_INET6) ? &tunnel6_handlers : &tunnel46_handlers;
45 *pprev; pprev = &(*pprev)->next) {
44 if ((*pprev)->priority > priority) 46 if ((*pprev)->priority > priority)
45 break; 47 break;
46 if ((*pprev)->priority == priority) 48 if ((*pprev)->priority == priority)
@@ -60,14 +62,15 @@ err:
60 62
61EXPORT_SYMBOL(xfrm6_tunnel_register); 63EXPORT_SYMBOL(xfrm6_tunnel_register);
62 64
63int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler) 65int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler, unsigned short family)
64{ 66{
65 struct xfrm6_tunnel **pprev; 67 struct xfrm6_tunnel **pprev;
66 int ret = -ENOENT; 68 int ret = -ENOENT;
67 69
68 mutex_lock(&tunnel6_mutex); 70 mutex_lock(&tunnel6_mutex);
69 71
70 for (pprev = &tunnel6_handlers; *pprev; pprev = &(*pprev)->next) { 72 for (pprev = (family == AF_INET6) ? &tunnel6_handlers : &tunnel46_handlers;
73 *pprev; pprev = &(*pprev)->next) {
71 if (*pprev == handler) { 74 if (*pprev == handler) {
72 *pprev = handler->next; 75 *pprev = handler->next;
73 ret = 0; 76 ret = 0;
@@ -103,6 +106,25 @@ drop:
103 return 0; 106 return 0;
104} 107}
105 108
109static int tunnel46_rcv(struct sk_buff **pskb)
110{
111 struct sk_buff *skb = *pskb;
112 struct xfrm6_tunnel *handler;
113
114 if (!pskb_may_pull(skb, sizeof(struct ipv6hdr)))
115 goto drop;
116
117 for (handler = tunnel46_handlers; handler; handler = handler->next)
118 if (!handler->handler(skb))
119 return 0;
120
121 icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_PORT_UNREACH, 0, skb->dev);
122
123drop:
124 kfree_skb(skb);
125 return 0;
126}
127
106static void tunnel6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, 128static void tunnel6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
107 int type, int code, int offset, __be32 info) 129 int type, int code, int offset, __be32 info)
108{ 130{
@@ -119,17 +141,30 @@ static struct inet6_protocol tunnel6_protocol = {
119 .flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL, 141 .flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL,
120}; 142};
121 143
144static struct inet6_protocol tunnel46_protocol = {
145 .handler = tunnel46_rcv,
146 .err_handler = tunnel6_err,
147 .flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL,
148};
149
122static int __init tunnel6_init(void) 150static int __init tunnel6_init(void)
123{ 151{
124 if (inet6_add_protocol(&tunnel6_protocol, IPPROTO_IPV6)) { 152 if (inet6_add_protocol(&tunnel6_protocol, IPPROTO_IPV6)) {
125 printk(KERN_ERR "tunnel6 init(): can't add protocol\n"); 153 printk(KERN_ERR "tunnel6 init(): can't add protocol\n");
126 return -EAGAIN; 154 return -EAGAIN;
127 } 155 }
156 if (inet6_add_protocol(&tunnel46_protocol, IPPROTO_IPIP)) {
157 printk(KERN_ERR "tunnel6 init(): can't add protocol\n");
158 inet6_del_protocol(&tunnel6_protocol, IPPROTO_IPV6);
159 return -EAGAIN;
160 }
128 return 0; 161 return 0;
129} 162}
130 163
131static void __exit tunnel6_fini(void) 164static void __exit tunnel6_fini(void)
132{ 165{
166 if (inet6_del_protocol(&tunnel46_protocol, IPPROTO_IPIP))
167 printk(KERN_ERR "tunnel6 close: can't remove protocol\n");
133 if (inet6_del_protocol(&tunnel6_protocol, IPPROTO_IPV6)) 168 if (inet6_del_protocol(&tunnel6_protocol, IPPROTO_IPV6))
134 printk(KERN_ERR "tunnel6 close: can't remove protocol\n"); 169 printk(KERN_ERR "tunnel6 close: can't remove protocol\n");
135} 170}
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index ccf2f4d196be..0ad471909881 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -27,7 +27,6 @@
27#include <linux/types.h> 27#include <linux/types.h>
28#include <linux/socket.h> 28#include <linux/socket.h>
29#include <linux/sockios.h> 29#include <linux/sockios.h>
30#include <linux/sched.h>
31#include <linux/net.h> 30#include <linux/net.h>
32#include <linux/in6.h> 31#include <linux/in6.h>
33#include <linux/netdevice.h> 32#include <linux/netdevice.h>
diff --git a/net/ipv6/xfrm6_input.c b/net/ipv6/xfrm6_input.c
index 25250147bdc3..31f651f95096 100644
--- a/net/ipv6/xfrm6_input.c
+++ b/net/ipv6/xfrm6_input.c
@@ -40,7 +40,8 @@ int xfrm6_rcv_spi(struct sk_buff *skb, __be32 spi)
40 if (xfrm_nr == XFRM_MAX_DEPTH) 40 if (xfrm_nr == XFRM_MAX_DEPTH)
41 goto drop; 41 goto drop;
42 42
43 x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, spi, nexthdr, AF_INET6); 43 x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, spi,
44 nexthdr != IPPROTO_IPIP ? nexthdr : IPPROTO_IPV6, AF_INET6);
44 if (x == NULL) 45 if (x == NULL)
45 goto drop; 46 goto drop;
46 spin_lock(&x->lock); 47 spin_lock(&x->lock);
diff --git a/net/ipv6/xfrm6_tunnel.c b/net/ipv6/xfrm6_tunnel.c
index fb0228772f01..ee4b84a33ff4 100644
--- a/net/ipv6/xfrm6_tunnel.c
+++ b/net/ipv6/xfrm6_tunnel.c
@@ -339,17 +339,29 @@ static struct xfrm6_tunnel xfrm6_tunnel_handler = {
339 .priority = 2, 339 .priority = 2,
340}; 340};
341 341
342static struct xfrm6_tunnel xfrm46_tunnel_handler = {
343 .handler = xfrm6_tunnel_rcv,
344 .err_handler = xfrm6_tunnel_err,
345 .priority = 2,
346};
347
342static int __init xfrm6_tunnel_init(void) 348static int __init xfrm6_tunnel_init(void)
343{ 349{
344 if (xfrm_register_type(&xfrm6_tunnel_type, AF_INET6) < 0) 350 if (xfrm_register_type(&xfrm6_tunnel_type, AF_INET6) < 0)
345 return -EAGAIN; 351 return -EAGAIN;
346 352
347 if (xfrm6_tunnel_register(&xfrm6_tunnel_handler)) { 353 if (xfrm6_tunnel_register(&xfrm6_tunnel_handler, AF_INET6)) {
354 xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
355 return -EAGAIN;
356 }
357 if (xfrm6_tunnel_register(&xfrm46_tunnel_handler, AF_INET)) {
358 xfrm6_tunnel_deregister(&xfrm6_tunnel_handler, AF_INET6);
348 xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6); 359 xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
349 return -EAGAIN; 360 return -EAGAIN;
350 } 361 }
351 if (xfrm6_tunnel_spi_init() < 0) { 362 if (xfrm6_tunnel_spi_init() < 0) {
352 xfrm6_tunnel_deregister(&xfrm6_tunnel_handler); 363 xfrm6_tunnel_deregister(&xfrm46_tunnel_handler, AF_INET);
364 xfrm6_tunnel_deregister(&xfrm6_tunnel_handler, AF_INET6);
353 xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6); 365 xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
354 return -EAGAIN; 366 return -EAGAIN;
355 } 367 }
@@ -359,7 +371,8 @@ static int __init xfrm6_tunnel_init(void)
359static void __exit xfrm6_tunnel_fini(void) 371static void __exit xfrm6_tunnel_fini(void)
360{ 372{
361 xfrm6_tunnel_spi_fini(); 373 xfrm6_tunnel_spi_fini();
362 xfrm6_tunnel_deregister(&xfrm6_tunnel_handler); 374 xfrm6_tunnel_deregister(&xfrm46_tunnel_handler, AF_INET);
375 xfrm6_tunnel_deregister(&xfrm6_tunnel_handler, AF_INET6);
363 xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6); 376 xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
364} 377}
365 378
diff --git a/net/ipx/sysctl_net_ipx.c b/net/ipx/sysctl_net_ipx.c
index 85ae35fa1e0e..0cf526450536 100644
--- a/net/ipx/sysctl_net_ipx.c
+++ b/net/ipx/sysctl_net_ipx.c
@@ -52,7 +52,7 @@ static struct ctl_table_header *ipx_table_header;
52 52
53void ipx_register_sysctl(void) 53void ipx_register_sysctl(void)
54{ 54{
55 ipx_table_header = register_sysctl_table(ipx_root_table, 1); 55 ipx_table_header = register_sysctl_table(ipx_root_table);
56} 56}
57 57
58void ipx_unregister_sysctl(void) 58void ipx_unregister_sysctl(void)
diff --git a/net/irda/ircomm/ircomm_core.c b/net/irda/ircomm/ircomm_core.c
index ec40715dcdda..4749f8f55391 100644
--- a/net/irda/ircomm/ircomm_core.c
+++ b/net/irda/ircomm/ircomm_core.c
@@ -30,7 +30,6 @@
30 ********************************************************************/ 30 ********************************************************************/
31 31
32#include <linux/module.h> 32#include <linux/module.h>
33#include <linux/sched.h>
34#include <linux/proc_fs.h> 33#include <linux/proc_fs.h>
35#include <linux/seq_file.h> 34#include <linux/seq_file.h>
36#include <linux/init.h> 35#include <linux/init.h>
diff --git a/net/irda/ircomm/ircomm_event.c b/net/irda/ircomm/ircomm_event.c
index 23d0468794e2..8ba4e59ece16 100644
--- a/net/irda/ircomm/ircomm_event.c
+++ b/net/irda/ircomm/ircomm_event.c
@@ -28,7 +28,6 @@
28 * 28 *
29 ********************************************************************/ 29 ********************************************************************/
30 30
31#include <linux/sched.h>
32#include <linux/proc_fs.h> 31#include <linux/proc_fs.h>
33#include <linux/init.h> 32#include <linux/init.h>
34 33
diff --git a/net/irda/ircomm/ircomm_lmp.c b/net/irda/ircomm/ircomm_lmp.c
index 22bd75299104..55860ee4e39e 100644
--- a/net/irda/ircomm/ircomm_lmp.c
+++ b/net/irda/ircomm/ircomm_lmp.c
@@ -30,7 +30,6 @@
30 * 30 *
31 ********************************************************************/ 31 ********************************************************************/
32 32
33#include <linux/sched.h>
34#include <linux/init.h> 33#include <linux/init.h>
35 34
36#include <net/irda/irda.h> 35#include <net/irda/irda.h>
diff --git a/net/irda/ircomm/ircomm_param.c b/net/irda/ircomm/ircomm_param.c
index fbac13e95b28..01d7c9c7b3b4 100644
--- a/net/irda/ircomm/ircomm_param.c
+++ b/net/irda/ircomm/ircomm_param.c
@@ -28,7 +28,6 @@
28 * 28 *
29 ********************************************************************/ 29 ********************************************************************/
30 30
31#include <linux/sched.h>
32#include <linux/workqueue.h> 31#include <linux/workqueue.h>
33#include <linux/interrupt.h> 32#include <linux/interrupt.h>
34 33
diff --git a/net/irda/ircomm/ircomm_ttp.c b/net/irda/ircomm/ircomm_ttp.c
index bb06ebaadd16..712eafd0cc76 100644
--- a/net/irda/ircomm/ircomm_ttp.c
+++ b/net/irda/ircomm/ircomm_ttp.c
@@ -29,7 +29,6 @@
29 * 29 *
30 ********************************************************************/ 30 ********************************************************************/
31 31
32#include <linux/sched.h>
33#include <linux/init.h> 32#include <linux/init.h>
34 33
35#include <net/irda/irda.h> 34#include <net/irda/irda.h>
diff --git a/net/irda/ircomm/ircomm_tty_attach.c b/net/irda/ircomm/ircomm_tty_attach.c
index 8d7ba93e4e09..824309dabfe9 100644
--- a/net/irda/ircomm/ircomm_tty_attach.c
+++ b/net/irda/ircomm/ircomm_tty_attach.c
@@ -29,7 +29,6 @@
29 * 29 *
30 ********************************************************************/ 30 ********************************************************************/
31 31
32#include <linux/sched.h>
33#include <linux/init.h> 32#include <linux/init.h>
34 33
35#include <net/irda/irda.h> 34#include <net/irda/irda.h>
diff --git a/net/irda/ircomm/ircomm_tty_ioctl.c b/net/irda/ircomm/ircomm_tty_ioctl.c
index a5174e6e7ad3..6030947b6d93 100644
--- a/net/irda/ircomm/ircomm_tty_ioctl.c
+++ b/net/irda/ircomm/ircomm_tty_ioctl.c
@@ -30,7 +30,6 @@
30 30
31#include <linux/init.h> 31#include <linux/init.h>
32#include <linux/fs.h> 32#include <linux/fs.h>
33#include <linux/sched.h>
34#include <linux/termios.h> 33#include <linux/termios.h>
35#include <linux/tty.h> 34#include <linux/tty.h>
36#include <linux/serial.h> 35#include <linux/serial.h>
diff --git a/net/irda/irsysctl.c b/net/irda/irsysctl.c
index bb53ba0be585..2e968e7d8fea 100644
--- a/net/irda/irsysctl.c
+++ b/net/irda/irsysctl.c
@@ -274,7 +274,7 @@ static struct ctl_table_header *irda_table_header;
274 */ 274 */
275int __init irda_sysctl_register(void) 275int __init irda_sysctl_register(void)
276{ 276{
277 irda_table_header = register_sysctl_table(irda_root_table, 0); 277 irda_table_header = register_sysctl_table(irda_root_table);
278 if (!irda_table_header) 278 if (!irda_table_header)
279 return -ENOMEM; 279 return -ENOMEM;
280 280
diff --git a/net/lapb/lapb_in.c b/net/lapb/lapb_in.c
index b0f8713f66ca..6762e7c751eb 100644
--- a/net/lapb/lapb_in.c
+++ b/net/lapb/lapb_in.c
@@ -20,7 +20,6 @@
20#include <linux/socket.h> 20#include <linux/socket.h>
21#include <linux/in.h> 21#include <linux/in.h>
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/sched.h>
24#include <linux/timer.h> 23#include <linux/timer.h>
25#include <linux/string.h> 24#include <linux/string.h>
26#include <linux/sockios.h> 25#include <linux/sockios.h>
diff --git a/net/lapb/lapb_out.c b/net/lapb/lapb_out.c
index 981beb5e5187..339cc5f2684f 100644
--- a/net/lapb/lapb_out.c
+++ b/net/lapb/lapb_out.c
@@ -19,7 +19,6 @@
19#include <linux/socket.h> 19#include <linux/socket.h>
20#include <linux/in.h> 20#include <linux/in.h>
21#include <linux/kernel.h> 21#include <linux/kernel.h>
22#include <linux/sched.h>
23#include <linux/timer.h> 22#include <linux/timer.h>
24#include <linux/string.h> 23#include <linux/string.h>
25#include <linux/sockios.h> 24#include <linux/sockios.h>
diff --git a/net/lapb/lapb_subr.c b/net/lapb/lapb_subr.c
index b8739cf9156d..b827f47ac133 100644
--- a/net/lapb/lapb_subr.c
+++ b/net/lapb/lapb_subr.c
@@ -18,7 +18,6 @@
18#include <linux/socket.h> 18#include <linux/socket.h>
19#include <linux/in.h> 19#include <linux/in.h>
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/sched.h>
22#include <linux/timer.h> 21#include <linux/timer.h>
23#include <linux/string.h> 22#include <linux/string.h>
24#include <linux/sockios.h> 23#include <linux/sockios.h>
diff --git a/net/llc/sysctl_net_llc.c b/net/llc/sysctl_net_llc.c
index d047a3e15714..46992d036017 100644
--- a/net/llc/sysctl_net_llc.c
+++ b/net/llc/sysctl_net_llc.c
@@ -116,7 +116,7 @@ static struct ctl_table_header *llc_table_header;
116 116
117int __init llc_sysctl_init(void) 117int __init llc_sysctl_init(void)
118{ 118{
119 llc_table_header = register_sysctl_table(llc_root_table, 1); 119 llc_table_header = register_sysctl_table(llc_root_table);
120 120
121 return llc_table_header ? 0 : -ENOMEM; 121 return llc_table_header ? 0 : -ENOMEM;
122} 122}
diff --git a/net/netfilter/nf_conntrack_proto_generic.c b/net/netfilter/nf_conntrack_proto_generic.c
index 69902531c236..7c069939695a 100644
--- a/net/netfilter/nf_conntrack_proto_generic.c
+++ b/net/netfilter/nf_conntrack_proto_generic.c
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/sched.h> 15#include <linux/jiffies.h>
16#include <linux/timer.h> 16#include <linux/timer.h>
17#include <linux/netfilter.h> 17#include <linux/netfilter.h>
18#include <net/netfilter/nf_conntrack_l4proto.h> 18#include <net/netfilter/nf_conntrack_l4proto.h>
diff --git a/net/netfilter/nf_conntrack_proto_sctp.c b/net/netfilter/nf_conntrack_proto_sctp.c
index 0133afa2c7ef..3c80558716a0 100644
--- a/net/netfilter/nf_conntrack_proto_sctp.c
+++ b/net/netfilter/nf_conntrack_proto_sctp.c
@@ -19,7 +19,6 @@
19 */ 19 */
20 20
21#include <linux/types.h> 21#include <linux/types.h>
22#include <linux/sched.h>
23#include <linux/timer.h> 22#include <linux/timer.h>
24#include <linux/netfilter.h> 23#include <linux/netfilter.h>
25#include <linux/module.h> 24#include <linux/module.h>
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c
index aff65aad3c66..069b85ca51cd 100644
--- a/net/netfilter/nf_conntrack_proto_tcp.c
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
@@ -25,7 +25,6 @@
25 */ 25 */
26 26
27#include <linux/types.h> 27#include <linux/types.h>
28#include <linux/sched.h>
29#include <linux/timer.h> 28#include <linux/timer.h>
30#include <linux/netfilter.h> 29#include <linux/netfilter.h>
31#include <linux/module.h> 30#include <linux/module.h>
diff --git a/net/netfilter/nf_conntrack_proto_udp.c b/net/netfilter/nf_conntrack_proto_udp.c
index e49cd25998c4..d0a1cee7ee52 100644
--- a/net/netfilter/nf_conntrack_proto_udp.c
+++ b/net/netfilter/nf_conntrack_proto_udp.c
@@ -12,7 +12,6 @@
12 */ 12 */
13 13
14#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/sched.h>
16#include <linux/timer.h> 15#include <linux/timer.h>
17#include <linux/module.h> 16#include <linux/module.h>
18#include <linux/netfilter.h> 17#include <linux/netfilter.h>
diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c
index a0bba481d70d..b8586360e519 100644
--- a/net/netfilter/nf_conntrack_standalone.c
+++ b/net/netfilter/nf_conntrack_standalone.c
@@ -445,7 +445,7 @@ static int __init nf_conntrack_standalone_init(void)
445 proc_stat->owner = THIS_MODULE; 445 proc_stat->owner = THIS_MODULE;
446#endif 446#endif
447#ifdef CONFIG_SYSCTL 447#ifdef CONFIG_SYSCTL
448 nf_ct_sysctl_header = register_sysctl_table(nf_ct_net_table, 0); 448 nf_ct_sysctl_header = register_sysctl_table(nf_ct_net_table);
449 if (nf_ct_sysctl_header == NULL) { 449 if (nf_ct_sysctl_header == NULL) {
450 printk("nf_conntrack: can't register to sysctl.\n"); 450 printk("nf_conntrack: can't register to sysctl.\n");
451 ret = -ENOMEM; 451 ret = -ENOMEM;
diff --git a/net/netfilter/nf_sysctl.c b/net/netfilter/nf_sysctl.c
index 06ddddb2911f..ee34589e48a4 100644
--- a/net/netfilter/nf_sysctl.c
+++ b/net/netfilter/nf_sysctl.c
@@ -56,7 +56,7 @@ nf_register_sysctl_table(struct ctl_table *path, struct ctl_table *table)
56 path = path_dup(path, table); 56 path = path_dup(path, table);
57 if (path == NULL) 57 if (path == NULL)
58 return NULL; 58 return NULL;
59 header = register_sysctl_table(path, 0); 59 header = register_sysctl_table(path);
60 if (header == NULL) 60 if (header == NULL)
61 path_free(path, table); 61 path_free(path, table);
62 return header; 62 return header;
diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c
index f42bb1366007..11d504d0ac72 100644
--- a/net/netfilter/nfnetlink.c
+++ b/net/netfilter/nfnetlink.c
@@ -19,7 +19,6 @@
19#include <linux/socket.h> 19#include <linux/socket.h>
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/major.h> 21#include <linux/major.h>
22#include <linux/sched.h>
23#include <linux/timer.h> 22#include <linux/timer.h>
24#include <linux/string.h> 23#include <linux/string.h>
25#include <linux/sockios.h> 24#include <linux/sockios.h>
diff --git a/net/netrom/nr_dev.c b/net/netrom/nr_dev.c
index 4700d5225b78..9a97ed6e6910 100644
--- a/net/netrom/nr_dev.c
+++ b/net/netrom/nr_dev.c
@@ -9,7 +9,6 @@
9#include <linux/module.h> 9#include <linux/module.h>
10#include <linux/proc_fs.h> 10#include <linux/proc_fs.h>
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/sched.h>
13#include <linux/interrupt.h> 12#include <linux/interrupt.h>
14#include <linux/fs.h> 13#include <linux/fs.h>
15#include <linux/types.h> 14#include <linux/types.h>
diff --git a/net/netrom/nr_in.c b/net/netrom/nr_in.c
index a7d88b5ad756..5560acbaaa95 100644
--- a/net/netrom/nr_in.c
+++ b/net/netrom/nr_in.c
@@ -12,7 +12,6 @@
12#include <linux/socket.h> 12#include <linux/socket.h>
13#include <linux/in.h> 13#include <linux/in.h>
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/sched.h>
16#include <linux/timer.h> 15#include <linux/timer.h>
17#include <linux/string.h> 16#include <linux/string.h>
18#include <linux/sockios.h> 17#include <linux/sockios.h>
diff --git a/net/netrom/nr_out.c b/net/netrom/nr_out.c
index 7939ded9c98c..0cbfb611465b 100644
--- a/net/netrom/nr_out.c
+++ b/net/netrom/nr_out.c
@@ -12,7 +12,6 @@
12#include <linux/socket.h> 12#include <linux/socket.h>
13#include <linux/in.h> 13#include <linux/in.h>
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/sched.h>
16#include <linux/timer.h> 15#include <linux/timer.h>
17#include <linux/string.h> 16#include <linux/string.h>
18#include <linux/sockios.h> 17#include <linux/sockios.h>
diff --git a/net/netrom/nr_route.c b/net/netrom/nr_route.c
index c2fbac9c69ce..8e6bd4e9d82c 100644
--- a/net/netrom/nr_route.c
+++ b/net/netrom/nr_route.c
@@ -13,7 +13,6 @@
13#include <linux/socket.h> 13#include <linux/socket.h>
14#include <linux/in.h> 14#include <linux/in.h>
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/sched.h>
17#include <linux/timer.h> 16#include <linux/timer.h>
18#include <linux/string.h> 17#include <linux/string.h>
19#include <linux/sockios.h> 18#include <linux/sockios.h>
diff --git a/net/netrom/nr_subr.c b/net/netrom/nr_subr.c
index cfab5721a608..07b694d18870 100644
--- a/net/netrom/nr_subr.c
+++ b/net/netrom/nr_subr.c
@@ -11,7 +11,6 @@
11#include <linux/socket.h> 11#include <linux/socket.h>
12#include <linux/in.h> 12#include <linux/in.h>
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/sched.h>
15#include <linux/timer.h> 14#include <linux/timer.h>
16#include <linux/string.h> 15#include <linux/string.h>
17#include <linux/sockios.h> 16#include <linux/sockios.h>
diff --git a/net/netrom/sysctl_net_netrom.c b/net/netrom/sysctl_net_netrom.c
index e4b27d7aae79..2ea68da01fb8 100644
--- a/net/netrom/sysctl_net_netrom.c
+++ b/net/netrom/sysctl_net_netrom.c
@@ -192,7 +192,7 @@ static ctl_table nr_root_table[] = {
192 192
193void __init nr_register_sysctl(void) 193void __init nr_register_sysctl(void)
194{ 194{
195 nr_table_header = register_sysctl_table(nr_root_table, 1); 195 nr_table_header = register_sysctl_table(nr_root_table);
196} 196}
197 197
198void nr_unregister_sysctl(void) 198void nr_unregister_sysctl(void)
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 15ff7b15e211..bf2699074774 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -50,7 +50,6 @@
50 */ 50 */
51 51
52#include <linux/types.h> 52#include <linux/types.h>
53#include <linux/sched.h>
54#include <linux/mm.h> 53#include <linux/mm.h>
55#include <linux/capability.h> 54#include <linux/capability.h>
56#include <linux/fcntl.h> 55#include <linux/fcntl.h>
diff --git a/net/rose/rose_dev.c b/net/rose/rose_dev.c
index 50824d345fa6..8d88795dc663 100644
--- a/net/rose/rose_dev.c
+++ b/net/rose/rose_dev.c
@@ -9,7 +9,6 @@
9#include <linux/module.h> 9#include <linux/module.h>
10#include <linux/proc_fs.h> 10#include <linux/proc_fs.h>
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/sched.h>
13#include <linux/interrupt.h> 12#include <linux/interrupt.h>
14#include <linux/fs.h> 13#include <linux/fs.h>
15#include <linux/types.h> 14#include <linux/types.h>
diff --git a/net/rose/rose_in.c b/net/rose/rose_in.c
index 8348d33f1efe..4ee0879d3540 100644
--- a/net/rose/rose_in.c
+++ b/net/rose/rose_in.c
@@ -16,7 +16,6 @@
16#include <linux/socket.h> 16#include <linux/socket.h>
17#include <linux/in.h> 17#include <linux/in.h>
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/sched.h>
20#include <linux/timer.h> 19#include <linux/timer.h>
21#include <linux/string.h> 20#include <linux/string.h>
22#include <linux/sockios.h> 21#include <linux/sockios.h>
diff --git a/net/rose/rose_out.c b/net/rose/rose_out.c
index 2965ffc83b9b..69820f93414b 100644
--- a/net/rose/rose_out.c
+++ b/net/rose/rose_out.c
@@ -11,7 +11,6 @@
11#include <linux/socket.h> 11#include <linux/socket.h>
12#include <linux/in.h> 12#include <linux/in.h>
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/sched.h>
15#include <linux/timer.h> 14#include <linux/timer.h>
16#include <linux/string.h> 15#include <linux/string.h>
17#include <linux/sockios.h> 16#include <linux/sockios.h>
diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c
index 1ddf7f5fa6db..a1233e1b1ab6 100644
--- a/net/rose/rose_route.c
+++ b/net/rose/rose_route.c
@@ -12,7 +12,6 @@
12#include <linux/socket.h> 12#include <linux/socket.h>
13#include <linux/in.h> 13#include <linux/in.h>
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/sched.h>
16#include <linux/timer.h> 15#include <linux/timer.h>
17#include <linux/string.h> 16#include <linux/string.h>
18#include <linux/sockios.h> 17#include <linux/sockios.h>
diff --git a/net/rose/rose_subr.c b/net/rose/rose_subr.c
index 36a77944622b..b05108f382da 100644
--- a/net/rose/rose_subr.c
+++ b/net/rose/rose_subr.c
@@ -11,7 +11,6 @@
11#include <linux/socket.h> 11#include <linux/socket.h>
12#include <linux/in.h> 12#include <linux/in.h>
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/sched.h>
15#include <linux/timer.h> 14#include <linux/timer.h>
16#include <linux/string.h> 15#include <linux/string.h>
17#include <linux/sockios.h> 16#include <linux/sockios.h>
diff --git a/net/rose/sysctl_net_rose.c b/net/rose/sysctl_net_rose.c
index 27a452bc5b8d..455b0555a669 100644
--- a/net/rose/sysctl_net_rose.c
+++ b/net/rose/sysctl_net_rose.c
@@ -160,7 +160,7 @@ static ctl_table rose_root_table[] = {
160 160
161void __init rose_register_sysctl(void) 161void __init rose_register_sysctl(void)
162{ 162{
163 rose_table_header = register_sysctl_table(rose_root_table, 1); 163 rose_table_header = register_sysctl_table(rose_root_table);
164} 164}
165 165
166void rose_unregister_sysctl(void) 166void rose_unregister_sysctl(void)
diff --git a/net/rxrpc/sysctl.c b/net/rxrpc/sysctl.c
index 0755ae028e43..884290754af7 100644
--- a/net/rxrpc/sysctl.c
+++ b/net/rxrpc/sysctl.c
@@ -97,7 +97,7 @@ static ctl_table rxrpc_dir_sysctl_table[] = {
97int rxrpc_sysctl_init(void) 97int rxrpc_sysctl_init(void)
98{ 98{
99#ifdef CONFIG_SYSCTL 99#ifdef CONFIG_SYSCTL
100 rxrpc_sysctl = register_sysctl_table(rxrpc_dir_sysctl_table, 0); 100 rxrpc_sysctl = register_sysctl_table(rxrpc_dir_sysctl_table);
101 if (!rxrpc_sysctl) 101 if (!rxrpc_sysctl)
102 return -ENOMEM; 102 return -ENOMEM;
103#endif /* CONFIG_SYSCTL */ 103#endif /* CONFIG_SYSCTL */
diff --git a/net/rxrpc/transport.c b/net/rxrpc/transport.c
index ff5f4f333086..8e57be2df936 100644
--- a/net/rxrpc/transport.c
+++ b/net/rxrpc/transport.c
@@ -9,7 +9,6 @@
9 * 2 of the License, or (at your option) any later version. 9 * 2 of the License, or (at your option) any later version.
10 */ 10 */
11 11
12#include <linux/sched.h>
13#include <linux/slab.h> 12#include <linux/slab.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <rxrpc/transport.h> 14#include <rxrpc/transport.h>
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index dd0868dfbd90..cb21617a5670 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -16,7 +16,6 @@
16#include <linux/bitops.h> 16#include <linux/bitops.h>
17#include <linux/types.h> 17#include <linux/types.h>
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/sched.h>
20#include <linux/string.h> 19#include <linux/string.h>
21#include <linux/mm.h> 20#include <linux/mm.h>
22#include <linux/socket.h> 21#include <linux/socket.h>
diff --git a/net/sched/act_gact.c b/net/sched/act_gact.c
index 60095d86fd8f..87d0faf32867 100644
--- a/net/sched/act_gact.c
+++ b/net/sched/act_gact.c
@@ -15,7 +15,6 @@
15#include <linux/bitops.h> 15#include <linux/bitops.h>
16#include <linux/types.h> 16#include <linux/types.h>
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/sched.h>
19#include <linux/string.h> 18#include <linux/string.h>
20#include <linux/mm.h> 19#include <linux/mm.h>
21#include <linux/socket.h> 20#include <linux/socket.h>
diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c
index 0fdabfa9f4bf..47f0b1324239 100644
--- a/net/sched/act_ipt.c
+++ b/net/sched/act_ipt.c
@@ -16,7 +16,6 @@
16#include <asm/bitops.h> 16#include <asm/bitops.h>
17#include <linux/types.h> 17#include <linux/types.h>
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/sched.h>
20#include <linux/string.h> 19#include <linux/string.h>
21#include <linux/mm.h> 20#include <linux/mm.h>
22#include <linux/socket.h> 21#include <linux/socket.h>
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index 483897271f15..68f26cb278f9 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -17,7 +17,6 @@
17#include <asm/bitops.h> 17#include <asm/bitops.h>
18#include <linux/types.h> 18#include <linux/types.h>
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/sched.h>
21#include <linux/string.h> 20#include <linux/string.h>
22#include <linux/mm.h> 21#include <linux/mm.h>
23#include <linux/socket.h> 22#include <linux/socket.h>
diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c
index 53aa96cd579b..3d6a2fcc9ce4 100644
--- a/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -14,7 +14,6 @@
14#include <asm/bitops.h> 14#include <asm/bitops.h>
15#include <linux/types.h> 15#include <linux/types.h>
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/sched.h>
18#include <linux/string.h> 17#include <linux/string.h>
19#include <linux/mm.h> 18#include <linux/mm.h>
20#include <linux/socket.h> 19#include <linux/socket.h>
diff --git a/net/sched/act_police.c b/net/sched/act_police.c
index 6ffe35da22b1..10a5a5c36f76 100644
--- a/net/sched/act_police.c
+++ b/net/sched/act_police.c
@@ -16,7 +16,6 @@
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/types.h> 17#include <linux/types.h>
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/sched.h>
20#include <linux/string.h> 19#include <linux/string.h>
21#include <linux/mm.h> 20#include <linux/mm.h>
22#include <linux/socket.h> 21#include <linux/socket.h>
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index f41f4ee0587a..5c6ffdb77d2d 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -20,7 +20,6 @@
20#include <linux/module.h> 20#include <linux/module.h>
21#include <linux/types.h> 21#include <linux/types.h>
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/sched.h>
24#include <linux/string.h> 23#include <linux/string.h>
25#include <linux/mm.h> 24#include <linux/mm.h>
26#include <linux/socket.h> 25#include <linux/socket.h>
diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c
index ea13c2c5b061..fad08e521c24 100644
--- a/net/sched/cls_basic.c
+++ b/net/sched/cls_basic.c
@@ -12,7 +12,6 @@
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/types.h> 13#include <linux/types.h>
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/sched.h>
16#include <linux/string.h> 15#include <linux/string.h>
17#include <linux/mm.h> 16#include <linux/mm.h>
18#include <linux/errno.h> 17#include <linux/errno.h>
diff --git a/net/sched/cls_fw.c b/net/sched/cls_fw.c
index 2ce3ce5c66eb..5dbb9d451f73 100644
--- a/net/sched/cls_fw.c
+++ b/net/sched/cls_fw.c
@@ -24,7 +24,6 @@
24#include <linux/bitops.h> 24#include <linux/bitops.h>
25#include <linux/types.h> 25#include <linux/types.h>
26#include <linux/kernel.h> 26#include <linux/kernel.h>
27#include <linux/sched.h>
28#include <linux/string.h> 27#include <linux/string.h>
29#include <linux/mm.h> 28#include <linux/mm.h>
30#include <linux/socket.h> 29#include <linux/socket.h>
diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c
index d3aea730d4c8..e85df07d8ce7 100644
--- a/net/sched/cls_route.c
+++ b/net/sched/cls_route.c
@@ -15,7 +15,6 @@
15#include <linux/bitops.h> 15#include <linux/bitops.h>
16#include <linux/types.h> 16#include <linux/types.h>
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/sched.h>
19#include <linux/string.h> 18#include <linux/string.h>
20#include <linux/mm.h> 19#include <linux/mm.h>
21#include <linux/socket.h> 20#include <linux/socket.h>
diff --git a/net/sched/cls_rsvp.c b/net/sched/cls_rsvp.c
index ad2613790d85..1d4a1fb17608 100644
--- a/net/sched/cls_rsvp.c
+++ b/net/sched/cls_rsvp.c
@@ -15,7 +15,6 @@
15#include <linux/bitops.h> 15#include <linux/bitops.h>
16#include <linux/types.h> 16#include <linux/types.h>
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/sched.h>
19#include <linux/string.h> 18#include <linux/string.h>
20#include <linux/mm.h> 19#include <linux/mm.h>
21#include <linux/socket.h> 20#include <linux/socket.h>
diff --git a/net/sched/cls_rsvp6.c b/net/sched/cls_rsvp6.c
index fde51f7848eb..a2979d89798f 100644
--- a/net/sched/cls_rsvp6.c
+++ b/net/sched/cls_rsvp6.c
@@ -15,7 +15,6 @@
15#include <linux/bitops.h> 15#include <linux/bitops.h>
16#include <linux/types.h> 16#include <linux/types.h>
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/sched.h>
19#include <linux/string.h> 18#include <linux/string.h>
20#include <linux/mm.h> 19#include <linux/mm.h>
21#include <linux/socket.h> 20#include <linux/socket.h>
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index a232671cfa4e..0bcb16928d25 100644
--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -36,7 +36,6 @@
36#include <linux/module.h> 36#include <linux/module.h>
37#include <linux/types.h> 37#include <linux/types.h>
38#include <linux/kernel.h> 38#include <linux/kernel.h>
39#include <linux/sched.h>
40#include <linux/string.h> 39#include <linux/string.h>
41#include <linux/mm.h> 40#include <linux/mm.h>
42#include <linux/socket.h> 41#include <linux/socket.h>
diff --git a/net/sched/em_nbyte.c b/net/sched/em_nbyte.c
index 42103b2bdc51..b4b36efce292 100644
--- a/net/sched/em_nbyte.c
+++ b/net/sched/em_nbyte.c
@@ -12,7 +12,6 @@
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/types.h> 13#include <linux/types.h>
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/sched.h>
16#include <linux/string.h> 15#include <linux/string.h>
17#include <linux/skbuff.h> 16#include <linux/skbuff.h>
18#include <linux/tc_ematch/tc_em_nbyte.h> 17#include <linux/tc_ematch/tc_em_nbyte.h>
diff --git a/net/sched/em_text.c b/net/sched/em_text.c
index 8ad894b58fce..e8f46169449d 100644
--- a/net/sched/em_text.c
+++ b/net/sched/em_text.c
@@ -12,7 +12,6 @@
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/types.h> 13#include <linux/types.h>
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/sched.h>
16#include <linux/string.h> 15#include <linux/string.h>
17#include <linux/skbuff.h> 16#include <linux/skbuff.h>
18#include <linux/textsearch.h> 17#include <linux/textsearch.h>
diff --git a/net/sched/ematch.c b/net/sched/ematch.c
index d3ad36b36129..959c306c5714 100644
--- a/net/sched/ematch.c
+++ b/net/sched/ematch.c
@@ -84,7 +84,6 @@
84#include <linux/module.h> 84#include <linux/module.h>
85#include <linux/types.h> 85#include <linux/types.h>
86#include <linux/kernel.h> 86#include <linux/kernel.h>
87#include <linux/sched.h>
88#include <linux/mm.h> 87#include <linux/mm.h>
89#include <linux/errno.h> 88#include <linux/errno.h>
90#include <linux/interrupt.h> 89#include <linux/interrupt.h>
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 4158127bc202..ecc988af4a9a 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -18,7 +18,6 @@
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/sched.h>
22#include <linux/string.h> 21#include <linux/string.h>
23#include <linux/mm.h> 22#include <linux/mm.h>
24#include <linux/socket.h> 23#include <linux/socket.h>
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
index 48830cac1014..76c92e710a33 100644
--- a/net/sched/sch_cbq.c
+++ b/net/sched/sch_cbq.c
@@ -16,7 +16,6 @@
16#include <linux/bitops.h> 16#include <linux/bitops.h>
17#include <linux/types.h> 17#include <linux/types.h>
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/sched.h>
20#include <linux/string.h> 19#include <linux/string.h>
21#include <linux/mm.h> 20#include <linux/mm.h>
22#include <linux/socket.h> 21#include <linux/socket.h>
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
index 135087d4213a..396deb71480f 100644
--- a/net/sched/sch_hfsc.c
+++ b/net/sched/sch_hfsc.c
@@ -71,8 +71,6 @@
71#include <asm/system.h> 71#include <asm/system.h>
72#include <asm/div64.h> 72#include <asm/div64.h>
73 73
74#define HFSC_DEBUG 1
75
76/* 74/*
77 * kernel internal service curve representation: 75 * kernel internal service curve representation:
78 * coordinates are given by 64 bit unsigned integers. 76 * coordinates are given by 64 bit unsigned integers.
@@ -211,17 +209,6 @@ do { \
211} while (0) 209} while (0)
212#endif 210#endif
213 211
214#if HFSC_DEBUG
215#define ASSERT(cond) \
216do { \
217 if (unlikely(!(cond))) \
218 printk("assertion %s failed at %s:%i (%s)\n", \
219 #cond, __FILE__, __LINE__, __FUNCTION__); \
220} while (0)
221#else
222#define ASSERT(cond)
223#endif /* HFSC_DEBUG */
224
225#define HT_INFINITY 0xffffffffffffffffULL /* infinite time value */ 212#define HT_INFINITY 0xffffffffffffffffULL /* infinite time value */
226 213
227 214
@@ -1492,7 +1479,7 @@ hfsc_schedule_watchdog(struct Qdisc *sch, u64 cur_time)
1492 if (next_time == 0 || next_time > q->root.cl_cfmin) 1479 if (next_time == 0 || next_time > q->root.cl_cfmin)
1493 next_time = q->root.cl_cfmin; 1480 next_time = q->root.cl_cfmin;
1494 } 1481 }
1495 ASSERT(next_time != 0); 1482 WARN_ON(next_time == 0);
1496 delay = next_time - cur_time; 1483 delay = next_time - cur_time;
1497 delay = PSCHED_US2JIFFIE(delay); 1484 delay = PSCHED_US2JIFFIE(delay);
1498 1485
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 1f098d862f92..97cbb9aec946 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -33,7 +33,6 @@
33#include <linux/bitops.h> 33#include <linux/bitops.h>
34#include <linux/types.h> 34#include <linux/types.h>
35#include <linux/kernel.h> 35#include <linux/kernel.h>
36#include <linux/sched.h>
37#include <linux/string.h> 36#include <linux/string.h>
38#include <linux/mm.h> 37#include <linux/mm.h>
39#include <linux/socket.h> 38#include <linux/socket.h>
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c
index 9f957ca5073b..de889f23f22a 100644
--- a/net/sched/sch_prio.c
+++ b/net/sched/sch_prio.c
@@ -17,7 +17,6 @@
17#include <linux/bitops.h> 17#include <linux/bitops.h>
18#include <linux/types.h> 18#include <linux/types.h>
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/sched.h>
21#include <linux/string.h> 20#include <linux/string.h>
22#include <linux/mm.h> 21#include <linux/mm.h>
23#include <linux/socket.h> 22#include <linux/socket.h>
diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c
index 6a66037abac9..587123c61af9 100644
--- a/net/sched/sch_teql.c
+++ b/net/sched/sch_teql.c
@@ -14,7 +14,6 @@
14#include <linux/bitops.h> 14#include <linux/bitops.h>
15#include <linux/types.h> 15#include <linux/types.h>
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/sched.h>
18#include <linux/string.h> 17#include <linux/string.h>
19#include <linux/mm.h> 18#include <linux/mm.h>
20#include <linux/socket.h> 19#include <linux/socket.h>
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index fca6f75b0a0d..fa82b73c965b 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -52,7 +52,6 @@
52#include <linux/fcntl.h> 52#include <linux/fcntl.h>
53#include <linux/poll.h> 53#include <linux/poll.h>
54#include <linux/init.h> 54#include <linux/init.h>
55#include <linux/sched.h>
56 55
57#include <linux/slab.h> 56#include <linux/slab.h>
58#include <linux/in.h> 57#include <linux/in.h>
diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c
index 80294cbc0de6..fdb287a9e2e2 100644
--- a/net/sctp/bind_addr.c
+++ b/net/sctp/bind_addr.c
@@ -43,7 +43,6 @@
43 */ 43 */
44 44
45#include <linux/types.h> 45#include <linux/types.h>
46#include <linux/sched.h>
47#include <linux/in.h> 46#include <linux/in.h>
48#include <net/sock.h> 47#include <net/sock.h>
49#include <net/ipv6.h> 48#include <net/ipv6.h>
diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c
index 286a8dbb63b7..1404a9e2e78f 100644
--- a/net/sctp/endpointola.c
+++ b/net/sctp/endpointola.c
@@ -50,7 +50,6 @@
50 */ 50 */
51 51
52#include <linux/types.h> 52#include <linux/types.h>
53#include <linux/sched.h>
54#include <linux/slab.h> 53#include <linux/slab.h>
55#include <linux/in.h> 54#include <linux/in.h>
56#include <linux/random.h> /* get_random_bytes() */ 55#include <linux/random.h> /* get_random_bytes() */
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index 01b27fb5dfc5..63fe1093b616 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -53,7 +53,6 @@
53#include <linux/socket.h> 53#include <linux/socket.h>
54#include <linux/sockios.h> 54#include <linux/sockios.h>
55#include <linux/net.h> 55#include <linux/net.h>
56#include <linux/sched.h>
57#include <linux/in.h> 56#include <linux/in.h>
58#include <linux/in6.h> 57#include <linux/in6.h>
59#include <linux/netdevice.h> 58#include <linux/netdevice.h>
diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c
index 633cd178654b..e2c679baf912 100644
--- a/net/sctp/sysctl.c
+++ b/net/sctp/sysctl.c
@@ -254,7 +254,7 @@ static struct ctl_table_header * sctp_sysctl_header;
254/* Sysctl registration. */ 254/* Sysctl registration. */
255void sctp_sysctl_register(void) 255void sctp_sysctl_register(void)
256{ 256{
257 sctp_sysctl_header = register_sysctl_table(sctp_root_table, 0); 257 sctp_sysctl_header = register_sysctl_table(sctp_root_table);
258} 258}
259 259
260/* Sysctl deregistration. */ 260/* Sysctl deregistration. */
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c
index 76f7eac4082d..9527f2bb1744 100644
--- a/net/sunrpc/auth.c
+++ b/net/sunrpc/auth.c
@@ -181,7 +181,7 @@ rpcauth_gc_credcache(struct rpc_auth *auth, struct hlist_head *free)
181 struct rpc_cred *cred; 181 struct rpc_cred *cred;
182 int i; 182 int i;
183 183
184 dprintk("RPC: gc'ing RPC credentials for auth %p\n", auth); 184 dprintk("RPC: gc'ing RPC credentials for auth %p\n", auth);
185 for (i = 0; i < RPC_CREDCACHE_NR; i++) { 185 for (i = 0; i < RPC_CREDCACHE_NR; i++) {
186 hlist_for_each_safe(pos, next, &cache->hashtable[i]) { 186 hlist_for_each_safe(pos, next, &cache->hashtable[i]) {
187 cred = hlist_entry(pos, struct rpc_cred, cr_hash); 187 cred = hlist_entry(pos, struct rpc_cred, cr_hash);
@@ -267,7 +267,7 @@ rpcauth_lookupcred(struct rpc_auth *auth, int flags)
267 }; 267 };
268 struct rpc_cred *ret; 268 struct rpc_cred *ret;
269 269
270 dprintk("RPC: looking up %s cred\n", 270 dprintk("RPC: looking up %s cred\n",
271 auth->au_ops->au_name); 271 auth->au_ops->au_name);
272 get_group_info(acred.group_info); 272 get_group_info(acred.group_info);
273 ret = auth->au_ops->lookup_cred(auth, &acred, flags); 273 ret = auth->au_ops->lookup_cred(auth, &acred, flags);
@@ -287,7 +287,7 @@ rpcauth_bindcred(struct rpc_task *task)
287 struct rpc_cred *ret; 287 struct rpc_cred *ret;
288 int flags = 0; 288 int flags = 0;
289 289
290 dprintk("RPC: %4d looking up %s cred\n", 290 dprintk("RPC: %5u looking up %s cred\n",
291 task->tk_pid, task->tk_auth->au_ops->au_name); 291 task->tk_pid, task->tk_auth->au_ops->au_name);
292 get_group_info(acred.group_info); 292 get_group_info(acred.group_info);
293 if (task->tk_flags & RPC_TASK_ROOTCREDS) 293 if (task->tk_flags & RPC_TASK_ROOTCREDS)
@@ -304,8 +304,9 @@ rpcauth_bindcred(struct rpc_task *task)
304void 304void
305rpcauth_holdcred(struct rpc_task *task) 305rpcauth_holdcred(struct rpc_task *task)
306{ 306{
307 dprintk("RPC: %4d holding %s cred %p\n", 307 dprintk("RPC: %5u holding %s cred %p\n",
308 task->tk_pid, task->tk_auth->au_ops->au_name, task->tk_msg.rpc_cred); 308 task->tk_pid, task->tk_auth->au_ops->au_name,
309 task->tk_msg.rpc_cred);
309 if (task->tk_msg.rpc_cred) 310 if (task->tk_msg.rpc_cred)
310 get_rpccred(task->tk_msg.rpc_cred); 311 get_rpccred(task->tk_msg.rpc_cred);
311} 312}
@@ -324,7 +325,7 @@ rpcauth_unbindcred(struct rpc_task *task)
324{ 325{
325 struct rpc_cred *cred = task->tk_msg.rpc_cred; 326 struct rpc_cred *cred = task->tk_msg.rpc_cred;
326 327
327 dprintk("RPC: %4d releasing %s cred %p\n", 328 dprintk("RPC: %5u releasing %s cred %p\n",
328 task->tk_pid, task->tk_auth->au_ops->au_name, cred); 329 task->tk_pid, task->tk_auth->au_ops->au_name, cred);
329 330
330 put_rpccred(cred); 331 put_rpccred(cred);
@@ -336,7 +337,7 @@ rpcauth_marshcred(struct rpc_task *task, __be32 *p)
336{ 337{
337 struct rpc_cred *cred = task->tk_msg.rpc_cred; 338 struct rpc_cred *cred = task->tk_msg.rpc_cred;
338 339
339 dprintk("RPC: %4d marshaling %s cred %p\n", 340 dprintk("RPC: %5u marshaling %s cred %p\n",
340 task->tk_pid, task->tk_auth->au_ops->au_name, cred); 341 task->tk_pid, task->tk_auth->au_ops->au_name, cred);
341 342
342 return cred->cr_ops->crmarshal(task, p); 343 return cred->cr_ops->crmarshal(task, p);
@@ -347,7 +348,7 @@ rpcauth_checkverf(struct rpc_task *task, __be32 *p)
347{ 348{
348 struct rpc_cred *cred = task->tk_msg.rpc_cred; 349 struct rpc_cred *cred = task->tk_msg.rpc_cred;
349 350
350 dprintk("RPC: %4d validating %s cred %p\n", 351 dprintk("RPC: %5u validating %s cred %p\n",
351 task->tk_pid, task->tk_auth->au_ops->au_name, cred); 352 task->tk_pid, task->tk_auth->au_ops->au_name, cred);
352 353
353 return cred->cr_ops->crvalidate(task, p); 354 return cred->cr_ops->crvalidate(task, p);
@@ -359,7 +360,7 @@ rpcauth_wrap_req(struct rpc_task *task, kxdrproc_t encode, void *rqstp,
359{ 360{
360 struct rpc_cred *cred = task->tk_msg.rpc_cred; 361 struct rpc_cred *cred = task->tk_msg.rpc_cred;
361 362
362 dprintk("RPC: %4d using %s cred %p to wrap rpc data\n", 363 dprintk("RPC: %5u using %s cred %p to wrap rpc data\n",
363 task->tk_pid, cred->cr_ops->cr_name, cred); 364 task->tk_pid, cred->cr_ops->cr_name, cred);
364 if (cred->cr_ops->crwrap_req) 365 if (cred->cr_ops->crwrap_req)
365 return cred->cr_ops->crwrap_req(task, encode, rqstp, data, obj); 366 return cred->cr_ops->crwrap_req(task, encode, rqstp, data, obj);
@@ -373,7 +374,7 @@ rpcauth_unwrap_resp(struct rpc_task *task, kxdrproc_t decode, void *rqstp,
373{ 374{
374 struct rpc_cred *cred = task->tk_msg.rpc_cred; 375 struct rpc_cred *cred = task->tk_msg.rpc_cred;
375 376
376 dprintk("RPC: %4d using %s cred %p to unwrap rpc data\n", 377 dprintk("RPC: %5u using %s cred %p to unwrap rpc data\n",
377 task->tk_pid, cred->cr_ops->cr_name, cred); 378 task->tk_pid, cred->cr_ops->cr_name, cred);
378 if (cred->cr_ops->crunwrap_resp) 379 if (cred->cr_ops->crunwrap_resp)
379 return cred->cr_ops->crunwrap_resp(task, decode, rqstp, 380 return cred->cr_ops->crunwrap_resp(task, decode, rqstp,
@@ -388,7 +389,7 @@ rpcauth_refreshcred(struct rpc_task *task)
388 struct rpc_cred *cred = task->tk_msg.rpc_cred; 389 struct rpc_cred *cred = task->tk_msg.rpc_cred;
389 int err; 390 int err;
390 391
391 dprintk("RPC: %4d refreshing %s cred %p\n", 392 dprintk("RPC: %5u refreshing %s cred %p\n",
392 task->tk_pid, task->tk_auth->au_ops->au_name, cred); 393 task->tk_pid, task->tk_auth->au_ops->au_name, cred);
393 394
394 err = cred->cr_ops->crrefresh(task); 395 err = cred->cr_ops->crrefresh(task);
@@ -400,7 +401,7 @@ rpcauth_refreshcred(struct rpc_task *task)
400void 401void
401rpcauth_invalcred(struct rpc_task *task) 402rpcauth_invalcred(struct rpc_task *task)
402{ 403{
403 dprintk("RPC: %4d invalidating %s cred %p\n", 404 dprintk("RPC: %5u invalidating %s cred %p\n",
404 task->tk_pid, task->tk_auth->au_ops->au_name, task->tk_msg.rpc_cred); 405 task->tk_pid, task->tk_auth->au_ops->au_name, task->tk_msg.rpc_cred);
405 spin_lock(&rpc_credcache_lock); 406 spin_lock(&rpc_credcache_lock);
406 if (task->tk_msg.rpc_cred) 407 if (task->tk_msg.rpc_cred)
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index 718fb94ad0f7..4e4ccc5b6fea 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -241,7 +241,7 @@ gss_fill_context(const void *p, const void *end, struct gss_cl_ctx *ctx, struct
241 } 241 }
242 return q; 242 return q;
243err: 243err:
244 dprintk("RPC: gss_fill_context returning %ld\n", -PTR_ERR(p)); 244 dprintk("RPC: gss_fill_context returning %ld\n", -PTR_ERR(p));
245 return p; 245 return p;
246} 246}
247 247
@@ -276,10 +276,10 @@ __gss_find_upcall(struct gss_auth *gss_auth, uid_t uid)
276 if (pos->uid != uid) 276 if (pos->uid != uid)
277 continue; 277 continue;
278 atomic_inc(&pos->count); 278 atomic_inc(&pos->count);
279 dprintk("RPC: gss_find_upcall found msg %p\n", pos); 279 dprintk("RPC: gss_find_upcall found msg %p\n", pos);
280 return pos; 280 return pos;
281 } 281 }
282 dprintk("RPC: gss_find_upcall found nothing\n"); 282 dprintk("RPC: gss_find_upcall found nothing\n");
283 return NULL; 283 return NULL;
284} 284}
285 285
@@ -393,7 +393,8 @@ gss_refresh_upcall(struct rpc_task *task)
393 struct gss_upcall_msg *gss_msg; 393 struct gss_upcall_msg *gss_msg;
394 int err = 0; 394 int err = 0;
395 395
396 dprintk("RPC: %4u gss_refresh_upcall for uid %u\n", task->tk_pid, cred->cr_uid); 396 dprintk("RPC: %5u gss_refresh_upcall for uid %u\n", task->tk_pid,
397 cred->cr_uid);
397 gss_msg = gss_setup_upcall(task->tk_client, gss_auth, cred); 398 gss_msg = gss_setup_upcall(task->tk_client, gss_auth, cred);
398 if (IS_ERR(gss_msg)) { 399 if (IS_ERR(gss_msg)) {
399 err = PTR_ERR(gss_msg); 400 err = PTR_ERR(gss_msg);
@@ -413,8 +414,8 @@ gss_refresh_upcall(struct rpc_task *task)
413 spin_unlock(&gss_auth->lock); 414 spin_unlock(&gss_auth->lock);
414 gss_release_msg(gss_msg); 415 gss_release_msg(gss_msg);
415out: 416out:
416 dprintk("RPC: %4u gss_refresh_upcall for uid %u result %d\n", task->tk_pid, 417 dprintk("RPC: %5u gss_refresh_upcall for uid %u result %d\n",
417 cred->cr_uid, err); 418 task->tk_pid, cred->cr_uid, err);
418 return err; 419 return err;
419} 420}
420 421
@@ -426,7 +427,7 @@ gss_create_upcall(struct gss_auth *gss_auth, struct gss_cred *gss_cred)
426 DEFINE_WAIT(wait); 427 DEFINE_WAIT(wait);
427 int err = 0; 428 int err = 0;
428 429
429 dprintk("RPC: gss_upcall for uid %u\n", cred->cr_uid); 430 dprintk("RPC: gss_upcall for uid %u\n", cred->cr_uid);
430 gss_msg = gss_setup_upcall(gss_auth->client, gss_auth, cred); 431 gss_msg = gss_setup_upcall(gss_auth->client, gss_auth, cred);
431 if (IS_ERR(gss_msg)) { 432 if (IS_ERR(gss_msg)) {
432 err = PTR_ERR(gss_msg); 433 err = PTR_ERR(gss_msg);
@@ -454,7 +455,8 @@ out_intr:
454 finish_wait(&gss_msg->waitqueue, &wait); 455 finish_wait(&gss_msg->waitqueue, &wait);
455 gss_release_msg(gss_msg); 456 gss_release_msg(gss_msg);
456out: 457out:
457 dprintk("RPC: gss_create_upcall for uid %u result %d\n", cred->cr_uid, err); 458 dprintk("RPC: gss_create_upcall for uid %u result %d\n",
459 cred->cr_uid, err);
458 return err; 460 return err;
459} 461}
460 462
@@ -546,14 +548,14 @@ gss_pipe_downcall(struct file *filp, const char __user *src, size_t mlen)
546 } 548 }
547 gss_put_ctx(ctx); 549 gss_put_ctx(ctx);
548 kfree(buf); 550 kfree(buf);
549 dprintk("RPC: gss_pipe_downcall returning length %Zu\n", mlen); 551 dprintk("RPC: gss_pipe_downcall returning length %Zu\n", mlen);
550 return mlen; 552 return mlen;
551err_put_ctx: 553err_put_ctx:
552 gss_put_ctx(ctx); 554 gss_put_ctx(ctx);
553err: 555err:
554 kfree(buf); 556 kfree(buf);
555out: 557out:
556 dprintk("RPC: gss_pipe_downcall returning %d\n", err); 558 dprintk("RPC: gss_pipe_downcall returning %d\n", err);
557 return err; 559 return err;
558} 560}
559 561
@@ -591,7 +593,7 @@ gss_pipe_destroy_msg(struct rpc_pipe_msg *msg)
591 static unsigned long ratelimit; 593 static unsigned long ratelimit;
592 594
593 if (msg->errno < 0) { 595 if (msg->errno < 0) {
594 dprintk("RPC: gss_pipe_destroy_msg releasing msg %p\n", 596 dprintk("RPC: gss_pipe_destroy_msg releasing msg %p\n",
595 gss_msg); 597 gss_msg);
596 atomic_inc(&gss_msg->count); 598 atomic_inc(&gss_msg->count);
597 gss_unhash_msg(gss_msg); 599 gss_unhash_msg(gss_msg);
@@ -618,7 +620,7 @@ gss_create(struct rpc_clnt *clnt, rpc_authflavor_t flavor)
618 struct rpc_auth * auth; 620 struct rpc_auth * auth;
619 int err = -ENOMEM; /* XXX? */ 621 int err = -ENOMEM; /* XXX? */
620 622
621 dprintk("RPC: creating GSS authenticator for client %p\n",clnt); 623 dprintk("RPC: creating GSS authenticator for client %p\n", clnt);
622 624
623 if (!try_module_get(THIS_MODULE)) 625 if (!try_module_get(THIS_MODULE))
624 return ERR_PTR(err); 626 return ERR_PTR(err);
@@ -670,8 +672,8 @@ gss_destroy(struct rpc_auth *auth)
670{ 672{
671 struct gss_auth *gss_auth; 673 struct gss_auth *gss_auth;
672 674
673 dprintk("RPC: destroying GSS authenticator %p flavor %d\n", 675 dprintk("RPC: destroying GSS authenticator %p flavor %d\n",
674 auth, auth->au_flavor); 676 auth, auth->au_flavor);
675 677
676 gss_auth = container_of(auth, struct gss_auth, rpc_auth); 678 gss_auth = container_of(auth, struct gss_auth, rpc_auth);
677 rpc_unlink(gss_auth->dentry); 679 rpc_unlink(gss_auth->dentry);
@@ -689,7 +691,7 @@ gss_destroy(struct rpc_auth *auth)
689static void 691static void
690gss_destroy_ctx(struct gss_cl_ctx *ctx) 692gss_destroy_ctx(struct gss_cl_ctx *ctx)
691{ 693{
692 dprintk("RPC: gss_destroy_ctx\n"); 694 dprintk("RPC: gss_destroy_ctx\n");
693 695
694 if (ctx->gc_gss_ctx) 696 if (ctx->gc_gss_ctx)
695 gss_delete_sec_context(&ctx->gc_gss_ctx); 697 gss_delete_sec_context(&ctx->gc_gss_ctx);
@@ -703,7 +705,7 @@ gss_destroy_cred(struct rpc_cred *rc)
703{ 705{
704 struct gss_cred *cred = container_of(rc, struct gss_cred, gc_base); 706 struct gss_cred *cred = container_of(rc, struct gss_cred, gc_base);
705 707
706 dprintk("RPC: gss_destroy_cred \n"); 708 dprintk("RPC: gss_destroy_cred \n");
707 709
708 if (cred->gc_ctx) 710 if (cred->gc_ctx)
709 gss_put_ctx(cred->gc_ctx); 711 gss_put_ctx(cred->gc_ctx);
@@ -726,7 +728,7 @@ gss_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags)
726 struct gss_cred *cred = NULL; 728 struct gss_cred *cred = NULL;
727 int err = -ENOMEM; 729 int err = -ENOMEM;
728 730
729 dprintk("RPC: gss_create_cred for uid %d, flavor %d\n", 731 dprintk("RPC: gss_create_cred for uid %d, flavor %d\n",
730 acred->uid, auth->au_flavor); 732 acred->uid, auth->au_flavor);
731 733
732 if (!(cred = kzalloc(sizeof(*cred), GFP_KERNEL))) 734 if (!(cred = kzalloc(sizeof(*cred), GFP_KERNEL)))
@@ -745,7 +747,7 @@ gss_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags)
745 return &cred->gc_base; 747 return &cred->gc_base;
746 748
747out_err: 749out_err:
748 dprintk("RPC: gss_create_cred failed with error %d\n", err); 750 dprintk("RPC: gss_create_cred failed with error %d\n", err);
749 return ERR_PTR(err); 751 return ERR_PTR(err);
750} 752}
751 753
@@ -799,7 +801,7 @@ gss_marshal(struct rpc_task *task, __be32 *p)
799 struct kvec iov; 801 struct kvec iov;
800 struct xdr_buf verf_buf; 802 struct xdr_buf verf_buf;
801 803
802 dprintk("RPC: %4u gss_marshal\n", task->tk_pid); 804 dprintk("RPC: %5u gss_marshal\n", task->tk_pid);
803 805
804 *p++ = htonl(RPC_AUTH_GSS); 806 *p++ = htonl(RPC_AUTH_GSS);
805 cred_len = p++; 807 cred_len = p++;
@@ -865,7 +867,7 @@ gss_validate(struct rpc_task *task, __be32 *p)
865 u32 flav,len; 867 u32 flav,len;
866 u32 maj_stat; 868 u32 maj_stat;
867 869
868 dprintk("RPC: %4u gss_validate\n", task->tk_pid); 870 dprintk("RPC: %5u gss_validate\n", task->tk_pid);
869 871
870 flav = ntohl(*p++); 872 flav = ntohl(*p++);
871 if ((len = ntohl(*p++)) > RPC_MAX_AUTH_SIZE) 873 if ((len = ntohl(*p++)) > RPC_MAX_AUTH_SIZE)
@@ -888,12 +890,12 @@ gss_validate(struct rpc_task *task, __be32 *p)
888 * calculate the length of the verifier: */ 890 * calculate the length of the verifier: */
889 task->tk_auth->au_verfsize = XDR_QUADLEN(len) + 2; 891 task->tk_auth->au_verfsize = XDR_QUADLEN(len) + 2;
890 gss_put_ctx(ctx); 892 gss_put_ctx(ctx);
891 dprintk("RPC: %4u GSS gss_validate: gss_verify_mic succeeded.\n", 893 dprintk("RPC: %5u gss_validate: gss_verify_mic succeeded.\n",
892 task->tk_pid); 894 task->tk_pid);
893 return p + XDR_QUADLEN(len); 895 return p + XDR_QUADLEN(len);
894out_bad: 896out_bad:
895 gss_put_ctx(ctx); 897 gss_put_ctx(ctx);
896 dprintk("RPC: %4u gss_validate failed.\n", task->tk_pid); 898 dprintk("RPC: %5u gss_validate failed.\n", task->tk_pid);
897 return NULL; 899 return NULL;
898} 900}
899 901
@@ -1063,7 +1065,7 @@ gss_wrap_req(struct rpc_task *task,
1063 struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred); 1065 struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred);
1064 int status = -EIO; 1066 int status = -EIO;
1065 1067
1066 dprintk("RPC: %4u gss_wrap_req\n", task->tk_pid); 1068 dprintk("RPC: %5u gss_wrap_req\n", task->tk_pid);
1067 if (ctx->gc_proc != RPC_GSS_PROC_DATA) { 1069 if (ctx->gc_proc != RPC_GSS_PROC_DATA) {
1068 /* The spec seems a little ambiguous here, but I think that not 1070 /* The spec seems a little ambiguous here, but I think that not
1069 * wrapping context destruction requests makes the most sense. 1071 * wrapping context destruction requests makes the most sense.
@@ -1086,7 +1088,7 @@ gss_wrap_req(struct rpc_task *task,
1086 } 1088 }
1087out: 1089out:
1088 gss_put_ctx(ctx); 1090 gss_put_ctx(ctx);
1089 dprintk("RPC: %4u gss_wrap_req returning %d\n", task->tk_pid, status); 1091 dprintk("RPC: %5u gss_wrap_req returning %d\n", task->tk_pid, status);
1090 return status; 1092 return status;
1091} 1093}
1092 1094
@@ -1192,7 +1194,7 @@ out_decode:
1192 status = decode(rqstp, p, obj); 1194 status = decode(rqstp, p, obj);
1193out: 1195out:
1194 gss_put_ctx(ctx); 1196 gss_put_ctx(ctx);
1195 dprintk("RPC: %4u gss_unwrap_resp returning %d\n", task->tk_pid, 1197 dprintk("RPC: %5u gss_unwrap_resp returning %d\n", task->tk_pid,
1196 status); 1198 status);
1197 return status; 1199 return status;
1198} 1200}
diff --git a/net/sunrpc/auth_gss/gss_krb5_crypto.c b/net/sunrpc/auth_gss/gss_krb5_crypto.c
index 0a9948de0992..f441aa0b26dc 100644
--- a/net/sunrpc/auth_gss/gss_krb5_crypto.c
+++ b/net/sunrpc/auth_gss/gss_krb5_crypto.c
@@ -66,8 +66,8 @@ krb5_encrypt(
66 goto out; 66 goto out;
67 67
68 if (crypto_blkcipher_ivsize(tfm) > 16) { 68 if (crypto_blkcipher_ivsize(tfm) > 16) {
69 dprintk("RPC: gss_k5encrypt: tfm iv size to large %d\n", 69 dprintk("RPC: gss_k5encrypt: tfm iv size to large %d\n",
70 crypto_blkcipher_ivsize(tfm)); 70 crypto_blkcipher_ivsize(tfm));
71 goto out; 71 goto out;
72 } 72 }
73 73
@@ -79,7 +79,7 @@ krb5_encrypt(
79 79
80 ret = crypto_blkcipher_encrypt_iv(&desc, sg, sg, length); 80 ret = crypto_blkcipher_encrypt_iv(&desc, sg, sg, length);
81out: 81out:
82 dprintk("RPC: krb5_encrypt returns %d\n",ret); 82 dprintk("RPC: krb5_encrypt returns %d\n", ret);
83 return ret; 83 return ret;
84} 84}
85 85
@@ -102,7 +102,7 @@ krb5_decrypt(
102 goto out; 102 goto out;
103 103
104 if (crypto_blkcipher_ivsize(tfm) > 16) { 104 if (crypto_blkcipher_ivsize(tfm) > 16) {
105 dprintk("RPC: gss_k5decrypt: tfm iv size to large %d\n", 105 dprintk("RPC: gss_k5decrypt: tfm iv size to large %d\n",
106 crypto_blkcipher_ivsize(tfm)); 106 crypto_blkcipher_ivsize(tfm));
107 goto out; 107 goto out;
108 } 108 }
@@ -114,7 +114,7 @@ krb5_decrypt(
114 114
115 ret = crypto_blkcipher_decrypt_iv(&desc, sg, sg, length); 115 ret = crypto_blkcipher_decrypt_iv(&desc, sg, sg, length);
116out: 116out:
117 dprintk("RPC: gss_k5decrypt returns %d\n",ret); 117 dprintk("RPC: gss_k5decrypt returns %d\n",ret);
118 return ret; 118 return ret;
119} 119}
120 120
diff --git a/net/sunrpc/auth_gss/gss_krb5_mech.c b/net/sunrpc/auth_gss/gss_krb5_mech.c
index 05d4bee86fc0..7b1943217053 100644
--- a/net/sunrpc/auth_gss/gss_krb5_mech.c
+++ b/net/sunrpc/auth_gss/gss_krb5_mech.c
@@ -175,7 +175,8 @@ gss_import_sec_context_kerberos(const void *p,
175 } 175 }
176 176
177 ctx_id->internal_ctx_id = ctx; 177 ctx_id->internal_ctx_id = ctx;
178 dprintk("RPC: Successfully imported new context.\n"); 178
179 dprintk("RPC: Successfully imported new context.\n");
179 return 0; 180 return 0;
180 181
181out_err_free_key2: 182out_err_free_key2:
diff --git a/net/sunrpc/auth_gss/gss_krb5_seal.c b/net/sunrpc/auth_gss/gss_krb5_seal.c
index d0bb5064f8c5..a0d9faa59cb5 100644
--- a/net/sunrpc/auth_gss/gss_krb5_seal.c
+++ b/net/sunrpc/auth_gss/gss_krb5_seal.c
@@ -83,7 +83,7 @@ gss_get_mic_kerberos(struct gss_ctx *gss_ctx, struct xdr_buf *text,
83 s32 now; 83 s32 now;
84 u32 seq_send; 84 u32 seq_send;
85 85
86 dprintk("RPC: gss_krb5_seal\n"); 86 dprintk("RPC: gss_krb5_seal\n");
87 87
88 now = get_seconds(); 88 now = get_seconds();
89 89
diff --git a/net/sunrpc/auth_gss/gss_krb5_seqnum.c b/net/sunrpc/auth_gss/gss_krb5_seqnum.c
index 3e315a68efaa..43f3421f1e6a 100644
--- a/net/sunrpc/auth_gss/gss_krb5_seqnum.c
+++ b/net/sunrpc/auth_gss/gss_krb5_seqnum.c
@@ -70,7 +70,7 @@ krb5_get_seq_num(struct crypto_blkcipher *key,
70 s32 code; 70 s32 code;
71 unsigned char plain[8]; 71 unsigned char plain[8];
72 72
73 dprintk("RPC: krb5_get_seq_num:\n"); 73 dprintk("RPC: krb5_get_seq_num:\n");
74 74
75 if ((code = krb5_decrypt(key, cksum, buf, plain, 8))) 75 if ((code = krb5_decrypt(key, cksum, buf, plain, 8)))
76 return code; 76 return code;
diff --git a/net/sunrpc/auth_gss/gss_krb5_unseal.c b/net/sunrpc/auth_gss/gss_krb5_unseal.c
index 87f8977ccece..e30a993466bc 100644
--- a/net/sunrpc/auth_gss/gss_krb5_unseal.c
+++ b/net/sunrpc/auth_gss/gss_krb5_unseal.c
@@ -86,7 +86,7 @@ gss_verify_mic_kerberos(struct gss_ctx *gss_ctx,
86 unsigned char *ptr = (unsigned char *)read_token->data; 86 unsigned char *ptr = (unsigned char *)read_token->data;
87 int bodysize; 87 int bodysize;
88 88
89 dprintk("RPC: krb5_read_token\n"); 89 dprintk("RPC: krb5_read_token\n");
90 90
91 if (g_verify_token_header(&ctx->mech_used, &bodysize, &ptr, 91 if (g_verify_token_header(&ctx->mech_used, &bodysize, &ptr,
92 read_token->len)) 92 read_token->len))
diff --git a/net/sunrpc/auth_gss/gss_krb5_wrap.c b/net/sunrpc/auth_gss/gss_krb5_wrap.c
index fe25b3d898dc..42b3220bed39 100644
--- a/net/sunrpc/auth_gss/gss_krb5_wrap.c
+++ b/net/sunrpc/auth_gss/gss_krb5_wrap.c
@@ -129,7 +129,7 @@ gss_wrap_kerberos(struct gss_ctx *ctx, int offset,
129 struct page **tmp_pages; 129 struct page **tmp_pages;
130 u32 seq_send; 130 u32 seq_send;
131 131
132 dprintk("RPC: gss_wrap_kerberos\n"); 132 dprintk("RPC: gss_wrap_kerberos\n");
133 133
134 now = get_seconds(); 134 now = get_seconds();
135 135
@@ -215,7 +215,7 @@ gss_unwrap_kerberos(struct gss_ctx *ctx, int offset, struct xdr_buf *buf)
215 int data_len; 215 int data_len;
216 int blocksize; 216 int blocksize;
217 217
218 dprintk("RPC: gss_unwrap_kerberos\n"); 218 dprintk("RPC: gss_unwrap_kerberos\n");
219 219
220 ptr = (u8 *)buf->head[0].iov_base + offset; 220 ptr = (u8 *)buf->head[0].iov_base + offset;
221 if (g_verify_token_header(&kctx->mech_used, &bodysize, &ptr, 221 if (g_verify_token_header(&kctx->mech_used, &bodysize, &ptr,
diff --git a/net/sunrpc/auth_gss/gss_mech_switch.c b/net/sunrpc/auth_gss/gss_mech_switch.c
index 3423890e4a30..26872517ccf3 100644
--- a/net/sunrpc/auth_gss/gss_mech_switch.c
+++ b/net/sunrpc/auth_gss/gss_mech_switch.c
@@ -113,7 +113,7 @@ gss_mech_register(struct gss_api_mech *gm)
113 spin_lock(&registered_mechs_lock); 113 spin_lock(&registered_mechs_lock);
114 list_add(&gm->gm_list, &registered_mechs); 114 list_add(&gm->gm_list, &registered_mechs);
115 spin_unlock(&registered_mechs_lock); 115 spin_unlock(&registered_mechs_lock);
116 dprintk("RPC: registered gss mechanism %s\n", gm->gm_name); 116 dprintk("RPC: registered gss mechanism %s\n", gm->gm_name);
117 return 0; 117 return 0;
118} 118}
119 119
@@ -125,7 +125,7 @@ gss_mech_unregister(struct gss_api_mech *gm)
125 spin_lock(&registered_mechs_lock); 125 spin_lock(&registered_mechs_lock);
126 list_del(&gm->gm_list); 126 list_del(&gm->gm_list);
127 spin_unlock(&registered_mechs_lock); 127 spin_unlock(&registered_mechs_lock);
128 dprintk("RPC: unregistered gss mechanism %s\n", gm->gm_name); 128 dprintk("RPC: unregistered gss mechanism %s\n", gm->gm_name);
129 gss_mech_free(gm); 129 gss_mech_free(gm);
130} 130}
131 131
@@ -298,7 +298,7 @@ gss_unwrap(struct gss_ctx *ctx_id,
298u32 298u32
299gss_delete_sec_context(struct gss_ctx **context_handle) 299gss_delete_sec_context(struct gss_ctx **context_handle)
300{ 300{
301 dprintk("RPC: gss_delete_sec_context deleting %p\n", 301 dprintk("RPC: gss_delete_sec_context deleting %p\n",
302 *context_handle); 302 *context_handle);
303 303
304 if (!*context_handle) 304 if (!*context_handle)
diff --git a/net/sunrpc/auth_gss/gss_spkm3_mech.c b/net/sunrpc/auth_gss/gss_spkm3_mech.c
index 8ef3f1c19435..7e15aa68ae64 100644
--- a/net/sunrpc/auth_gss/gss_spkm3_mech.c
+++ b/net/sunrpc/auth_gss/gss_spkm3_mech.c
@@ -97,7 +97,8 @@ gss_import_sec_context_spkm3(const void *p, size_t len,
97 if (IS_ERR(p)) 97 if (IS_ERR(p))
98 goto out_err_free_ctx; 98 goto out_err_free_ctx;
99 if (version != 1) { 99 if (version != 1) {
100 dprintk("RPC: unknown spkm3 token format: obsolete nfs-utils?\n"); 100 dprintk("RPC: unknown spkm3 token format: "
101 "obsolete nfs-utils?\n");
101 goto out_err_free_ctx; 102 goto out_err_free_ctx;
102 } 103 }
103 104
@@ -138,7 +139,7 @@ gss_import_sec_context_spkm3(const void *p, size_t len,
138 139
139 ctx_id->internal_ctx_id = ctx; 140 ctx_id->internal_ctx_id = ctx;
140 141
141 dprintk("Successfully imported new spkm context.\n"); 142 dprintk("RPC: Successfully imported new spkm context.\n");
142 return 0; 143 return 0;
143 144
144out_err_free_intg_key: 145out_err_free_intg_key:
@@ -183,7 +184,7 @@ gss_verify_mic_spkm3(struct gss_ctx *ctx,
183 184
184 maj_stat = spkm3_read_token(sctx, checksum, signbuf, SPKM_MIC_TOK); 185 maj_stat = spkm3_read_token(sctx, checksum, signbuf, SPKM_MIC_TOK);
185 186
186 dprintk("RPC: gss_verify_mic_spkm3 returning %d\n", maj_stat); 187 dprintk("RPC: gss_verify_mic_spkm3 returning %d\n", maj_stat);
187 return maj_stat; 188 return maj_stat;
188} 189}
189 190
@@ -197,7 +198,7 @@ gss_get_mic_spkm3(struct gss_ctx *ctx,
197 198
198 err = spkm3_make_token(sctx, message_buffer, 199 err = spkm3_make_token(sctx, message_buffer,
199 message_token, SPKM_MIC_TOK); 200 message_token, SPKM_MIC_TOK);
200 dprintk("RPC: gss_get_mic_spkm3 returning %d\n", err); 201 dprintk("RPC: gss_get_mic_spkm3 returning %d\n", err);
201 return err; 202 return err;
202} 203}
203 204
diff --git a/net/sunrpc/auth_gss/gss_spkm3_seal.c b/net/sunrpc/auth_gss/gss_spkm3_seal.c
index b179d58c6249..104cbf4f769f 100644
--- a/net/sunrpc/auth_gss/gss_spkm3_seal.c
+++ b/net/sunrpc/auth_gss/gss_spkm3_seal.c
@@ -75,20 +75,21 @@ spkm3_make_token(struct spkm3_ctx *ctx,
75 now = jiffies; 75 now = jiffies;
76 76
77 if (ctx->ctx_id.len != 16) { 77 if (ctx->ctx_id.len != 16) {
78 dprintk("RPC: spkm3_make_token BAD ctx_id.len %d\n", 78 dprintk("RPC: spkm3_make_token BAD ctx_id.len %d\n",
79 ctx->ctx_id.len); 79 ctx->ctx_id.len);
80 goto out_err; 80 goto out_err;
81 } 81 }
82 82
83 if (!g_OID_equal(&ctx->intg_alg, &hmac_md5_oid)) { 83 if (!g_OID_equal(&ctx->intg_alg, &hmac_md5_oid)) {
84 dprintk("RPC: gss_spkm3_seal: unsupported I-ALG algorithm." 84 dprintk("RPC: gss_spkm3_seal: unsupported I-ALG "
85 "only support hmac-md5 I-ALG.\n"); 85 "algorithm. only support hmac-md5 I-ALG.\n");
86 goto out_err; 86 goto out_err;
87 } else 87 } else
88 checksum_type = CKSUMTYPE_HMAC_MD5; 88 checksum_type = CKSUMTYPE_HMAC_MD5;
89 89
90 if (!g_OID_equal(&ctx->conf_alg, &cast5_cbc_oid)) { 90 if (!g_OID_equal(&ctx->conf_alg, &cast5_cbc_oid)) {
91 dprintk("RPC: gss_spkm3_seal: unsupported C-ALG algorithm\n"); 91 dprintk("RPC: gss_spkm3_seal: unsupported C-ALG "
92 "algorithm\n");
92 goto out_err; 93 goto out_err;
93 } 94 }
94 95
@@ -113,7 +114,8 @@ spkm3_make_token(struct spkm3_ctx *ctx,
113 114
114 spkm3_make_mic_token(&ptr, tokenlen, &mic_hdr, &md5cksum, md5elen, md5zbit); 115 spkm3_make_mic_token(&ptr, tokenlen, &mic_hdr, &md5cksum, md5elen, md5zbit);
115 } else if (toktype == SPKM_WRAP_TOK) { /* Not Supported */ 116 } else if (toktype == SPKM_WRAP_TOK) { /* Not Supported */
116 dprintk("RPC: gss_spkm3_seal: SPKM_WRAP_TOK not supported\n"); 117 dprintk("RPC: gss_spkm3_seal: SPKM_WRAP_TOK "
118 "not supported\n");
117 goto out_err; 119 goto out_err;
118 } 120 }
119 121
@@ -153,7 +155,7 @@ make_spkm3_checksum(s32 cksumtype, struct xdr_netobj *key, char *header,
153 cksumname = "md5"; 155 cksumname = "md5";
154 break; 156 break;
155 default: 157 default:
156 dprintk("RPC: spkm3_make_checksum:" 158 dprintk("RPC: spkm3_make_checksum:"
157 " unsupported checksum %d", cksumtype); 159 " unsupported checksum %d", cksumtype);
158 return GSS_S_FAILURE; 160 return GSS_S_FAILURE;
159 } 161 }
diff --git a/net/sunrpc/auth_gss/gss_spkm3_token.c b/net/sunrpc/auth_gss/gss_spkm3_token.c
index 8400b621971e..6cdd241ad267 100644
--- a/net/sunrpc/auth_gss/gss_spkm3_token.c
+++ b/net/sunrpc/auth_gss/gss_spkm3_token.c
@@ -209,7 +209,7 @@ spkm3_verify_mic_token(unsigned char **tokp, int *mic_hdrlen, unsigned char **ck
209 209
210 /* spkm3 innercontext token preamble */ 210 /* spkm3 innercontext token preamble */
211 if ((ptr[0] != 0xa4) || (ptr[2] != 0x30)) { 211 if ((ptr[0] != 0xa4) || (ptr[2] != 0x30)) {
212 dprintk("RPC: BAD SPKM ictoken preamble\n"); 212 dprintk("RPC: BAD SPKM ictoken preamble\n");
213 goto out; 213 goto out;
214 } 214 }
215 215
@@ -217,25 +217,25 @@ spkm3_verify_mic_token(unsigned char **tokp, int *mic_hdrlen, unsigned char **ck
217 217
218 /* token type */ 218 /* token type */
219 if ((ptr[4] != 0x02) || (ptr[5] != 0x02)) { 219 if ((ptr[4] != 0x02) || (ptr[5] != 0x02)) {
220 dprintk("RPC: BAD asn1 SPKM3 token type\n"); 220 dprintk("RPC: BAD asn1 SPKM3 token type\n");
221 goto out; 221 goto out;
222 } 222 }
223 223
224 /* only support SPKM_MIC_TOK */ 224 /* only support SPKM_MIC_TOK */
225 if((ptr[6] != 0x01) || (ptr[7] != 0x01)) { 225 if((ptr[6] != 0x01) || (ptr[7] != 0x01)) {
226 dprintk("RPC: ERROR unsupported SPKM3 token \n"); 226 dprintk("RPC: ERROR unsupported SPKM3 token \n");
227 goto out; 227 goto out;
228 } 228 }
229 229
230 /* contextid */ 230 /* contextid */
231 if (ptr[8] != 0x03) { 231 if (ptr[8] != 0x03) {
232 dprintk("RPC: BAD SPKM3 asn1 context-id type\n"); 232 dprintk("RPC: BAD SPKM3 asn1 context-id type\n");
233 goto out; 233 goto out;
234 } 234 }
235 235
236 ctxelen = ptr[9]; 236 ctxelen = ptr[9];
237 if (ctxelen > 17) { /* length includes asn1 zbit octet */ 237 if (ctxelen > 17) { /* length includes asn1 zbit octet */
238 dprintk("RPC: BAD SPKM3 contextid len %d\n", ctxelen); 238 dprintk("RPC: BAD SPKM3 contextid len %d\n", ctxelen);
239 goto out; 239 goto out;
240 } 240 }
241 241
@@ -251,7 +251,9 @@ spkm3_verify_mic_token(unsigned char **tokp, int *mic_hdrlen, unsigned char **ck
251 */ 251 */
252 252
253 if (*mic_hdrlen != 6 + ctxelen) { 253 if (*mic_hdrlen != 6 + ctxelen) {
254 dprintk("RPC: BAD SPKM_ MIC_TOK header len %d: we only support default int-alg (should be absent) and do not support snd-seq\n", *mic_hdrlen); 254 dprintk("RPC: BAD SPKM_ MIC_TOK header len %d: we only "
255 "support default int-alg (should be absent) "
256 "and do not support snd-seq\n", *mic_hdrlen);
255 goto out; 257 goto out;
256 } 258 }
257 /* checksum */ 259 /* checksum */
diff --git a/net/sunrpc/auth_gss/gss_spkm3_unseal.c b/net/sunrpc/auth_gss/gss_spkm3_unseal.c
index 35a1b34c4a1d..cc21ee860bb6 100644
--- a/net/sunrpc/auth_gss/gss_spkm3_unseal.c
+++ b/net/sunrpc/auth_gss/gss_spkm3_unseal.c
@@ -72,7 +72,7 @@ spkm3_read_token(struct spkm3_ctx *ctx,
72 /* decode the token */ 72 /* decode the token */
73 73
74 if (toktype != SPKM_MIC_TOK) { 74 if (toktype != SPKM_MIC_TOK) {
75 dprintk("RPC: BAD SPKM3 token type: %d\n", toktype); 75 dprintk("RPC: BAD SPKM3 token type: %d\n", toktype);
76 goto out; 76 goto out;
77 } 77 }
78 78
@@ -80,7 +80,7 @@ spkm3_read_token(struct spkm3_ctx *ctx,
80 goto out; 80 goto out;
81 81
82 if (*cksum++ != 0x03) { 82 if (*cksum++ != 0x03) {
83 dprintk("RPC: spkm3_read_token BAD checksum type\n"); 83 dprintk("RPC: spkm3_read_token BAD checksum type\n");
84 goto out; 84 goto out;
85 } 85 }
86 md5elen = *cksum++; 86 md5elen = *cksum++;
@@ -97,7 +97,8 @@ spkm3_read_token(struct spkm3_ctx *ctx,
97 */ 97 */
98 ret = GSS_S_DEFECTIVE_TOKEN; 98 ret = GSS_S_DEFECTIVE_TOKEN;
99 if (!g_OID_equal(&ctx->intg_alg, &hmac_md5_oid)) { 99 if (!g_OID_equal(&ctx->intg_alg, &hmac_md5_oid)) {
100 dprintk("RPC: gss_spkm3_seal: unsupported I-ALG algorithm\n"); 100 dprintk("RPC: gss_spkm3_seal: unsupported I-ALG "
101 "algorithm\n");
101 goto out; 102 goto out;
102 } 103 }
103 104
@@ -113,7 +114,7 @@ spkm3_read_token(struct spkm3_ctx *ctx,
113 ret = GSS_S_BAD_SIG; 114 ret = GSS_S_BAD_SIG;
114 code = memcmp(md5cksum.data, wire_cksum.data, wire_cksum.len); 115 code = memcmp(md5cksum.data, wire_cksum.data, wire_cksum.len);
115 if (code) { 116 if (code) {
116 dprintk("RPC: bad MIC checksum\n"); 117 dprintk("RPC: bad MIC checksum\n");
117 goto out; 118 goto out;
118 } 119 }
119 120
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
index 8fde38ecaf21..db298b501c81 100644
--- a/net/sunrpc/auth_gss/svcauth_gss.c
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
@@ -669,14 +669,14 @@ gss_verify_header(struct svc_rqst *rqstp, struct rsc *rsci,
669 } 669 }
670 670
671 if (gc->gc_seq > MAXSEQ) { 671 if (gc->gc_seq > MAXSEQ) {
672 dprintk("RPC: svcauth_gss: discarding request with large sequence number %d\n", 672 dprintk("RPC: svcauth_gss: discarding request with "
673 gc->gc_seq); 673 "large sequence number %d\n", gc->gc_seq);
674 *authp = rpcsec_gsserr_ctxproblem; 674 *authp = rpcsec_gsserr_ctxproblem;
675 return SVC_DENIED; 675 return SVC_DENIED;
676 } 676 }
677 if (!gss_check_seq_num(rsci, gc->gc_seq)) { 677 if (!gss_check_seq_num(rsci, gc->gc_seq)) {
678 dprintk("RPC: svcauth_gss: discarding request with old sequence number %d\n", 678 dprintk("RPC: svcauth_gss: discarding request with "
679 gc->gc_seq); 679 "old sequence number %d\n", gc->gc_seq);
680 return SVC_DROP; 680 return SVC_DROP;
681 } 681 }
682 return SVC_OK; 682 return SVC_OK;
@@ -958,7 +958,8 @@ svcauth_gss_accept(struct svc_rqst *rqstp, __be32 *authp)
958 __be32 *reject_stat = resv->iov_base + resv->iov_len; 958 __be32 *reject_stat = resv->iov_base + resv->iov_len;
959 int ret; 959 int ret;
960 960
961 dprintk("RPC: svcauth_gss: argv->iov_len = %zd\n",argv->iov_len); 961 dprintk("RPC: svcauth_gss: argv->iov_len = %zd\n",
962 argv->iov_len);
962 963
963 *authp = rpc_autherr_badcred; 964 *authp = rpc_autherr_badcred;
964 if (!svcdata) 965 if (!svcdata)
diff --git a/net/sunrpc/auth_null.c b/net/sunrpc/auth_null.c
index 3be257dc32b2..3df9fccab2f8 100644
--- a/net/sunrpc/auth_null.c
+++ b/net/sunrpc/auth_null.c
@@ -10,7 +10,6 @@
10#include <linux/module.h> 10#include <linux/module.h>
11#include <linux/utsname.h> 11#include <linux/utsname.h>
12#include <linux/sunrpc/clnt.h> 12#include <linux/sunrpc/clnt.h>
13#include <linux/sched.h>
14 13
15#ifdef RPC_DEBUG 14#ifdef RPC_DEBUG
16# define RPCDBG_FACILITY RPCDBG_AUTH 15# define RPCDBG_FACILITY RPCDBG_AUTH
diff --git a/net/sunrpc/auth_unix.c b/net/sunrpc/auth_unix.c
index f7f990c9afe2..4e7733aee36e 100644
--- a/net/sunrpc/auth_unix.c
+++ b/net/sunrpc/auth_unix.c
@@ -39,7 +39,8 @@ static struct rpc_credops unix_credops;
39static struct rpc_auth * 39static struct rpc_auth *
40unx_create(struct rpc_clnt *clnt, rpc_authflavor_t flavor) 40unx_create(struct rpc_clnt *clnt, rpc_authflavor_t flavor)
41{ 41{
42 dprintk("RPC: creating UNIX authenticator for client %p\n", clnt); 42 dprintk("RPC: creating UNIX authenticator for client %p\n",
43 clnt);
43 if (atomic_inc_return(&unix_auth.au_count) == 0) 44 if (atomic_inc_return(&unix_auth.au_count) == 0)
44 unix_cred_cache.nextgc = jiffies + (unix_cred_cache.expire >> 1); 45 unix_cred_cache.nextgc = jiffies + (unix_cred_cache.expire >> 1);
45 return &unix_auth; 46 return &unix_auth;
@@ -48,7 +49,7 @@ unx_create(struct rpc_clnt *clnt, rpc_authflavor_t flavor)
48static void 49static void
49unx_destroy(struct rpc_auth *auth) 50unx_destroy(struct rpc_auth *auth)
50{ 51{
51 dprintk("RPC: destroying UNIX authenticator %p\n", auth); 52 dprintk("RPC: destroying UNIX authenticator %p\n", auth);
52 rpcauth_free_credcache(auth); 53 rpcauth_free_credcache(auth);
53} 54}
54 55
@@ -67,8 +68,8 @@ unx_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags)
67 struct unx_cred *cred; 68 struct unx_cred *cred;
68 int i; 69 int i;
69 70
70 dprintk("RPC: allocating UNIX cred for uid %d gid %d\n", 71 dprintk("RPC: allocating UNIX cred for uid %d gid %d\n",
71 acred->uid, acred->gid); 72 acred->uid, acred->gid);
72 73
73 if (!(cred = kmalloc(sizeof(*cred), GFP_KERNEL))) 74 if (!(cred = kmalloc(sizeof(*cred), GFP_KERNEL)))
74 return ERR_PTR(-ENOMEM); 75 return ERR_PTR(-ENOMEM);
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index 8612044b9189..f02f24ae9468 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -215,7 +215,8 @@ int cache_check(struct cache_detail *detail,
215 if (rv == -EAGAIN) 215 if (rv == -EAGAIN)
216 rv = -ENOENT; 216 rv = -ENOENT;
217 } else if (rv == -EAGAIN || age > refresh_age/2) { 217 } else if (rv == -EAGAIN || age > refresh_age/2) {
218 dprintk("Want update, refage=%ld, age=%ld\n", refresh_age, age); 218 dprintk("RPC: Want update, refage=%ld, age=%ld\n",
219 refresh_age, age);
219 if (!test_and_set_bit(CACHE_PENDING, &h->flags)) { 220 if (!test_and_set_bit(CACHE_PENDING, &h->flags)) {
220 switch (cache_make_upcall(detail, h)) { 221 switch (cache_make_upcall(detail, h)) {
221 case -EINVAL: 222 case -EINVAL:
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index c95a61736d1c..6d7221fe990a 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -42,6 +42,10 @@
42# define RPCDBG_FACILITY RPCDBG_CALL 42# define RPCDBG_FACILITY RPCDBG_CALL
43#endif 43#endif
44 44
45#define dprint_status(t) \
46 dprintk("RPC: %5u %s (status %d)\n", t->tk_pid, \
47 __FUNCTION__, t->tk_status)
48
45static DECLARE_WAIT_QUEUE_HEAD(destroy_wait); 49static DECLARE_WAIT_QUEUE_HEAD(destroy_wait);
46 50
47 51
@@ -106,8 +110,8 @@ static struct rpc_clnt * rpc_new_client(struct rpc_xprt *xprt, char *servname, s
106 int err; 110 int err;
107 int len; 111 int len;
108 112
109 dprintk("RPC: creating %s client for %s (xprt %p)\n", 113 dprintk("RPC: creating %s client for %s (xprt %p)\n",
110 program->name, servname, xprt); 114 program->name, servname, xprt);
111 115
112 err = -EINVAL; 116 err = -EINVAL;
113 if (!xprt) 117 if (!xprt)
@@ -220,7 +224,7 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args)
220 xprt->resvport = 0; 224 xprt->resvport = 0;
221 225
222 dprintk("RPC: creating %s client for %s (xprt %p)\n", 226 dprintk("RPC: creating %s client for %s (xprt %p)\n",
223 args->program->name, args->servername, xprt); 227 args->program->name, args->servername, xprt);
224 228
225 clnt = rpc_new_client(xprt, args->servername, args->program, 229 clnt = rpc_new_client(xprt, args->servername, args->program,
226 args->version, args->authflavor); 230 args->version, args->authflavor);
@@ -245,6 +249,8 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args)
245 clnt->cl_autobind = 1; 249 clnt->cl_autobind = 1;
246 if (args->flags & RPC_CLNT_CREATE_ONESHOT) 250 if (args->flags & RPC_CLNT_CREATE_ONESHOT)
247 clnt->cl_oneshot = 1; 251 clnt->cl_oneshot = 1;
252 if (args->flags & RPC_CLNT_CREATE_DISCRTRY)
253 clnt->cl_discrtry = 1;
248 254
249 return clnt; 255 return clnt;
250} 256}
@@ -288,7 +294,7 @@ out_no_path:
288out_no_stats: 294out_no_stats:
289 kfree(new); 295 kfree(new);
290out_no_clnt: 296out_no_clnt:
291 dprintk("RPC: %s returned error %d\n", __FUNCTION__, err); 297 dprintk("RPC: %s: returned error %d\n", __FUNCTION__, err);
292 return ERR_PTR(err); 298 return ERR_PTR(err);
293} 299}
294 300
@@ -301,7 +307,7 @@ out_no_clnt:
301int 307int
302rpc_shutdown_client(struct rpc_clnt *clnt) 308rpc_shutdown_client(struct rpc_clnt *clnt)
303{ 309{
304 dprintk("RPC: shutting down %s client for %s, tasks=%d\n", 310 dprintk("RPC: shutting down %s client for %s, tasks=%d\n",
305 clnt->cl_protname, clnt->cl_server, 311 clnt->cl_protname, clnt->cl_server,
306 atomic_read(&clnt->cl_users)); 312 atomic_read(&clnt->cl_users));
307 313
@@ -336,7 +342,7 @@ rpc_destroy_client(struct rpc_clnt *clnt)
336 return 1; 342 return 1;
337 BUG_ON(atomic_read(&clnt->cl_users) != 0); 343 BUG_ON(atomic_read(&clnt->cl_users) != 0);
338 344
339 dprintk("RPC: destroying %s client for %s\n", 345 dprintk("RPC: destroying %s client for %s\n",
340 clnt->cl_protname, clnt->cl_server); 346 clnt->cl_protname, clnt->cl_server);
341 if (clnt->cl_auth) { 347 if (clnt->cl_auth) {
342 rpcauth_destroy(clnt->cl_auth); 348 rpcauth_destroy(clnt->cl_auth);
@@ -366,8 +372,8 @@ out_free:
366void 372void
367rpc_release_client(struct rpc_clnt *clnt) 373rpc_release_client(struct rpc_clnt *clnt)
368{ 374{
369 dprintk("RPC: rpc_release_client(%p, %d)\n", 375 dprintk("RPC: rpc_release_client(%p, %d)\n",
370 clnt, atomic_read(&clnt->cl_users)); 376 clnt, atomic_read(&clnt->cl_users));
371 377
372 if (!atomic_dec_and_test(&clnt->cl_users)) 378 if (!atomic_dec_and_test(&clnt->cl_users))
373 return; 379 return;
@@ -486,17 +492,13 @@ int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg, int flags)
486 /* Mask signals on RPC calls _and_ GSS_AUTH upcalls */ 492 /* Mask signals on RPC calls _and_ GSS_AUTH upcalls */
487 rpc_task_sigmask(task, &oldset); 493 rpc_task_sigmask(task, &oldset);
488 494
489 rpc_call_setup(task, msg, 0);
490
491 /* Set up the call info struct and execute the task */ 495 /* Set up the call info struct and execute the task */
496 rpc_call_setup(task, msg, 0);
497 if (task->tk_status == 0) {
498 atomic_inc(&task->tk_count);
499 rpc_execute(task);
500 }
492 status = task->tk_status; 501 status = task->tk_status;
493 if (status != 0)
494 goto out;
495 atomic_inc(&task->tk_count);
496 status = rpc_execute(task);
497 if (status == 0)
498 status = task->tk_status;
499out:
500 rpc_put_task(task); 502 rpc_put_task(task);
501 rpc_restore_sigmask(&oldset); 503 rpc_restore_sigmask(&oldset);
502 return status; 504 return status;
@@ -658,9 +660,10 @@ call_start(struct rpc_task *task)
658{ 660{
659 struct rpc_clnt *clnt = task->tk_client; 661 struct rpc_clnt *clnt = task->tk_client;
660 662
661 dprintk("RPC: %4d call_start %s%d proc %d (%s)\n", task->tk_pid, 663 dprintk("RPC: %5u call_start %s%d proc %d (%s)\n", task->tk_pid,
662 clnt->cl_protname, clnt->cl_vers, task->tk_msg.rpc_proc->p_proc, 664 clnt->cl_protname, clnt->cl_vers,
663 (RPC_IS_ASYNC(task) ? "async" : "sync")); 665 task->tk_msg.rpc_proc->p_proc,
666 (RPC_IS_ASYNC(task) ? "async" : "sync"));
664 667
665 /* Increment call count */ 668 /* Increment call count */
666 task->tk_msg.rpc_proc->p_count++; 669 task->tk_msg.rpc_proc->p_count++;
@@ -674,7 +677,7 @@ call_start(struct rpc_task *task)
674static void 677static void
675call_reserve(struct rpc_task *task) 678call_reserve(struct rpc_task *task)
676{ 679{
677 dprintk("RPC: %4d call_reserve\n", task->tk_pid); 680 dprint_status(task);
678 681
679 if (!rpcauth_uptodatecred(task)) { 682 if (!rpcauth_uptodatecred(task)) {
680 task->tk_action = call_refresh; 683 task->tk_action = call_refresh;
@@ -694,8 +697,7 @@ call_reserveresult(struct rpc_task *task)
694{ 697{
695 int status = task->tk_status; 698 int status = task->tk_status;
696 699
697 dprintk("RPC: %4d call_reserveresult (status %d)\n", 700 dprint_status(task);
698 task->tk_pid, task->tk_status);
699 701
700 /* 702 /*
701 * After a call to xprt_reserve(), we must have either 703 * After a call to xprt_reserve(), we must have either
@@ -749,8 +751,8 @@ call_allocate(struct rpc_task *task)
749 struct rpc_xprt *xprt = task->tk_xprt; 751 struct rpc_xprt *xprt = task->tk_xprt;
750 unsigned int bufsiz; 752 unsigned int bufsiz;
751 753
752 dprintk("RPC: %4d call_allocate (status %d)\n", 754 dprint_status(task);
753 task->tk_pid, task->tk_status); 755
754 task->tk_action = call_bind; 756 task->tk_action = call_bind;
755 if (req->rq_buffer) 757 if (req->rq_buffer)
756 return; 758 return;
@@ -761,7 +763,8 @@ call_allocate(struct rpc_task *task)
761 763
762 if (xprt->ops->buf_alloc(task, bufsiz << 1) != NULL) 764 if (xprt->ops->buf_alloc(task, bufsiz << 1) != NULL)
763 return; 765 return;
764 printk(KERN_INFO "RPC: buffer allocation failed for task %p\n", task); 766
767 dprintk("RPC: %5u rpc_buffer allocation failed\n", task->tk_pid);
765 768
766 if (RPC_IS_ASYNC(task) || !signalled()) { 769 if (RPC_IS_ASYNC(task) || !signalled()) {
767 xprt_release(task); 770 xprt_release(task);
@@ -798,8 +801,7 @@ call_encode(struct rpc_task *task)
798 kxdrproc_t encode; 801 kxdrproc_t encode;
799 __be32 *p; 802 __be32 *p;
800 803
801 dprintk("RPC: %4d call_encode (status %d)\n", 804 dprint_status(task);
802 task->tk_pid, task->tk_status);
803 805
804 /* Default buffer setup */ 806 /* Default buffer setup */
805 bufsiz = req->rq_bufsize >> 1; 807 bufsiz = req->rq_bufsize >> 1;
@@ -845,8 +847,7 @@ call_bind(struct rpc_task *task)
845{ 847{
846 struct rpc_xprt *xprt = task->tk_xprt; 848 struct rpc_xprt *xprt = task->tk_xprt;
847 849
848 dprintk("RPC: %4d call_bind (status %d)\n", 850 dprint_status(task);
849 task->tk_pid, task->tk_status);
850 851
851 task->tk_action = call_connect; 852 task->tk_action = call_connect;
852 if (!xprt_bound(xprt)) { 853 if (!xprt_bound(xprt)) {
@@ -865,8 +866,7 @@ call_bind_status(struct rpc_task *task)
865 int status = -EACCES; 866 int status = -EACCES;
866 867
867 if (task->tk_status >= 0) { 868 if (task->tk_status >= 0) {
868 dprintk("RPC: %4d call_bind_status (status %d)\n", 869 dprint_status(task);
869 task->tk_pid, task->tk_status);
870 task->tk_status = 0; 870 task->tk_status = 0;
871 task->tk_action = call_connect; 871 task->tk_action = call_connect;
872 return; 872 return;
@@ -874,24 +874,24 @@ call_bind_status(struct rpc_task *task)
874 874
875 switch (task->tk_status) { 875 switch (task->tk_status) {
876 case -EACCES: 876 case -EACCES:
877 dprintk("RPC: %4d remote rpcbind: RPC program/version unavailable\n", 877 dprintk("RPC: %5u remote rpcbind: RPC program/version "
878 task->tk_pid); 878 "unavailable\n", task->tk_pid);
879 rpc_delay(task, 3*HZ); 879 rpc_delay(task, 3*HZ);
880 goto retry_timeout; 880 goto retry_timeout;
881 case -ETIMEDOUT: 881 case -ETIMEDOUT:
882 dprintk("RPC: %4d rpcbind request timed out\n", 882 dprintk("RPC: %5u rpcbind request timed out\n",
883 task->tk_pid); 883 task->tk_pid);
884 goto retry_timeout; 884 goto retry_timeout;
885 case -EPFNOSUPPORT: 885 case -EPFNOSUPPORT:
886 dprintk("RPC: %4d remote rpcbind service unavailable\n", 886 dprintk("RPC: %5u remote rpcbind service unavailable\n",
887 task->tk_pid); 887 task->tk_pid);
888 break; 888 break;
889 case -EPROTONOSUPPORT: 889 case -EPROTONOSUPPORT:
890 dprintk("RPC: %4d remote rpcbind version 2 unavailable\n", 890 dprintk("RPC: %5u remote rpcbind version 2 unavailable\n",
891 task->tk_pid); 891 task->tk_pid);
892 break; 892 break;
893 default: 893 default:
894 dprintk("RPC: %4d unrecognized rpcbind error (%d)\n", 894 dprintk("RPC: %5u unrecognized rpcbind error (%d)\n",
895 task->tk_pid, -task->tk_status); 895 task->tk_pid, -task->tk_status);
896 status = -EIO; 896 status = -EIO;
897 } 897 }
@@ -911,7 +911,7 @@ call_connect(struct rpc_task *task)
911{ 911{
912 struct rpc_xprt *xprt = task->tk_xprt; 912 struct rpc_xprt *xprt = task->tk_xprt;
913 913
914 dprintk("RPC: %4d call_connect xprt %p %s connected\n", 914 dprintk("RPC: %5u call_connect xprt %p %s connected\n",
915 task->tk_pid, xprt, 915 task->tk_pid, xprt,
916 (xprt_connected(xprt) ? "is" : "is not")); 916 (xprt_connected(xprt) ? "is" : "is not"));
917 917
@@ -933,8 +933,7 @@ call_connect_status(struct rpc_task *task)
933 struct rpc_clnt *clnt = task->tk_client; 933 struct rpc_clnt *clnt = task->tk_client;
934 int status = task->tk_status; 934 int status = task->tk_status;
935 935
936 dprintk("RPC: %5u call_connect_status (status %d)\n", 936 dprint_status(task);
937 task->tk_pid, task->tk_status);
938 937
939 task->tk_status = 0; 938 task->tk_status = 0;
940 if (status >= 0) { 939 if (status >= 0) {
@@ -966,8 +965,7 @@ call_connect_status(struct rpc_task *task)
966static void 965static void
967call_transmit(struct rpc_task *task) 966call_transmit(struct rpc_task *task)
968{ 967{
969 dprintk("RPC: %4d call_transmit (status %d)\n", 968 dprint_status(task);
970 task->tk_pid, task->tk_status);
971 969
972 task->tk_action = call_status; 970 task->tk_action = call_status;
973 if (task->tk_status < 0) 971 if (task->tk_status < 0)
@@ -1028,8 +1026,7 @@ call_status(struct rpc_task *task)
1028 if (req->rq_received > 0 && !req->rq_bytes_sent) 1026 if (req->rq_received > 0 && !req->rq_bytes_sent)
1029 task->tk_status = req->rq_received; 1027 task->tk_status = req->rq_received;
1030 1028
1031 dprintk("RPC: %4d call_status (status %d)\n", 1029 dprint_status(task);
1032 task->tk_pid, task->tk_status);
1033 1030
1034 status = task->tk_status; 1031 status = task->tk_status;
1035 if (status >= 0) { 1032 if (status >= 0) {
@@ -1080,11 +1077,11 @@ call_timeout(struct rpc_task *task)
1080 struct rpc_clnt *clnt = task->tk_client; 1077 struct rpc_clnt *clnt = task->tk_client;
1081 1078
1082 if (xprt_adjust_timeout(task->tk_rqstp) == 0) { 1079 if (xprt_adjust_timeout(task->tk_rqstp) == 0) {
1083 dprintk("RPC: %4d call_timeout (minor)\n", task->tk_pid); 1080 dprintk("RPC: %5u call_timeout (minor)\n", task->tk_pid);
1084 goto retry; 1081 goto retry;
1085 } 1082 }
1086 1083
1087 dprintk("RPC: %4d call_timeout (major)\n", task->tk_pid); 1084 dprintk("RPC: %5u call_timeout (major)\n", task->tk_pid);
1088 task->tk_timeouts++; 1085 task->tk_timeouts++;
1089 1086
1090 if (RPC_IS_SOFT(task)) { 1087 if (RPC_IS_SOFT(task)) {
@@ -1118,8 +1115,8 @@ call_decode(struct rpc_task *task)
1118 kxdrproc_t decode = task->tk_msg.rpc_proc->p_decode; 1115 kxdrproc_t decode = task->tk_msg.rpc_proc->p_decode;
1119 __be32 *p; 1116 __be32 *p;
1120 1117
1121 dprintk("RPC: %4d call_decode (status %d)\n", 1118 dprintk("RPC: %5u call_decode (status %d)\n",
1122 task->tk_pid, task->tk_status); 1119 task->tk_pid, task->tk_status);
1123 1120
1124 if (task->tk_flags & RPC_CALL_MAJORSEEN) { 1121 if (task->tk_flags & RPC_CALL_MAJORSEEN) {
1125 printk(KERN_NOTICE "%s: server %s OK\n", 1122 printk(KERN_NOTICE "%s: server %s OK\n",
@@ -1133,8 +1130,8 @@ call_decode(struct rpc_task *task)
1133 clnt->cl_stats->rpcretrans++; 1130 clnt->cl_stats->rpcretrans++;
1134 goto out_retry; 1131 goto out_retry;
1135 } 1132 }
1136 dprintk("%s: too small RPC reply size (%d bytes)\n", 1133 dprintk("RPC: %s: too small RPC reply size (%d bytes)\n",
1137 clnt->cl_protname, task->tk_status); 1134 clnt->cl_protname, task->tk_status);
1138 task->tk_action = call_timeout; 1135 task->tk_action = call_timeout;
1139 goto out_retry; 1136 goto out_retry;
1140 } 1137 }
@@ -1166,8 +1163,8 @@ call_decode(struct rpc_task *task)
1166 task->tk_msg.rpc_resp); 1163 task->tk_msg.rpc_resp);
1167 unlock_kernel(); 1164 unlock_kernel();
1168 } 1165 }
1169 dprintk("RPC: %4d call_decode result %d\n", task->tk_pid, 1166 dprintk("RPC: %5u call_decode result %d\n", task->tk_pid,
1170 task->tk_status); 1167 task->tk_status);
1171 return; 1168 return;
1172out_retry: 1169out_retry:
1173 req->rq_received = req->rq_private_buf.len = 0; 1170 req->rq_received = req->rq_private_buf.len = 0;
@@ -1180,7 +1177,7 @@ out_retry:
1180static void 1177static void
1181call_refresh(struct rpc_task *task) 1178call_refresh(struct rpc_task *task)
1182{ 1179{
1183 dprintk("RPC: %4d call_refresh\n", task->tk_pid); 1180 dprint_status(task);
1184 1181
1185 xprt_release(task); /* Must do to obtain new XID */ 1182 xprt_release(task); /* Must do to obtain new XID */
1186 task->tk_action = call_refreshresult; 1183 task->tk_action = call_refreshresult;
@@ -1196,8 +1193,8 @@ static void
1196call_refreshresult(struct rpc_task *task) 1193call_refreshresult(struct rpc_task *task)
1197{ 1194{
1198 int status = task->tk_status; 1195 int status = task->tk_status;
1199 dprintk("RPC: %4d call_refreshresult (status %d)\n", 1196
1200 task->tk_pid, task->tk_status); 1197 dprint_status(task);
1201 1198
1202 task->tk_status = 0; 1199 task->tk_status = 0;
1203 task->tk_action = call_reserve; 1200 task->tk_action = call_reserve;
@@ -1275,11 +1272,15 @@ call_verify(struct rpc_task *task)
1275 case RPC_AUTH_ERROR: 1272 case RPC_AUTH_ERROR:
1276 break; 1273 break;
1277 case RPC_MISMATCH: 1274 case RPC_MISMATCH:
1278 dprintk("%s: RPC call version mismatch!\n", __FUNCTION__); 1275 dprintk("RPC: %5u %s: RPC call version "
1276 "mismatch!\n",
1277 task->tk_pid, __FUNCTION__);
1279 error = -EPROTONOSUPPORT; 1278 error = -EPROTONOSUPPORT;
1280 goto out_err; 1279 goto out_err;
1281 default: 1280 default:
1282 dprintk("%s: RPC call rejected, unknown error: %x\n", __FUNCTION__, n); 1281 dprintk("RPC: %5u %s: RPC call rejected, "
1282 "unknown error: %x\n",
1283 task->tk_pid, __FUNCTION__, n);
1283 goto out_eio; 1284 goto out_eio;
1284 } 1285 }
1285 if (--len < 0) 1286 if (--len < 0)
@@ -1292,8 +1293,8 @@ call_verify(struct rpc_task *task)
1292 if (!task->tk_cred_retry) 1293 if (!task->tk_cred_retry)
1293 break; 1294 break;
1294 task->tk_cred_retry--; 1295 task->tk_cred_retry--;
1295 dprintk("RPC: %4d call_verify: retry stale creds\n", 1296 dprintk("RPC: %5u %s: retry stale creds\n",
1296 task->tk_pid); 1297 task->tk_pid, __FUNCTION__);
1297 rpcauth_invalcred(task); 1298 rpcauth_invalcred(task);
1298 task->tk_action = call_refresh; 1299 task->tk_action = call_refresh;
1299 goto out_retry; 1300 goto out_retry;
@@ -1303,8 +1304,8 @@ call_verify(struct rpc_task *task)
1303 if (!task->tk_garb_retry) 1304 if (!task->tk_garb_retry)
1304 break; 1305 break;
1305 task->tk_garb_retry--; 1306 task->tk_garb_retry--;
1306 dprintk("RPC: %4d call_verify: retry garbled creds\n", 1307 dprintk("RPC: %5u %s: retry garbled creds\n",
1307 task->tk_pid); 1308 task->tk_pid, __FUNCTION__);
1308 task->tk_action = call_bind; 1309 task->tk_action = call_bind;
1309 goto out_retry; 1310 goto out_retry;
1310 case RPC_AUTH_TOOWEAK: 1311 case RPC_AUTH_TOOWEAK:
@@ -1315,8 +1316,8 @@ call_verify(struct rpc_task *task)
1315 printk(KERN_WARNING "call_verify: unknown auth error: %x\n", n); 1316 printk(KERN_WARNING "call_verify: unknown auth error: %x\n", n);
1316 error = -EIO; 1317 error = -EIO;
1317 } 1318 }
1318 dprintk("RPC: %4d call_verify: call rejected %d\n", 1319 dprintk("RPC: %5u %s: call rejected %d\n",
1319 task->tk_pid, n); 1320 task->tk_pid, __FUNCTION__, n);
1320 goto out_err; 1321 goto out_err;
1321 } 1322 }
1322 if (!(p = rpcauth_checkverf(task, p))) { 1323 if (!(p = rpcauth_checkverf(task, p))) {
@@ -1330,20 +1331,24 @@ call_verify(struct rpc_task *task)
1330 case RPC_SUCCESS: 1331 case RPC_SUCCESS:
1331 return p; 1332 return p;
1332 case RPC_PROG_UNAVAIL: 1333 case RPC_PROG_UNAVAIL:
1333 dprintk("RPC: call_verify: program %u is unsupported by server %s\n", 1334 dprintk("RPC: %5u %s: program %u is unsupported by server %s\n",
1335 task->tk_pid, __FUNCTION__,
1334 (unsigned int)task->tk_client->cl_prog, 1336 (unsigned int)task->tk_client->cl_prog,
1335 task->tk_client->cl_server); 1337 task->tk_client->cl_server);
1336 error = -EPFNOSUPPORT; 1338 error = -EPFNOSUPPORT;
1337 goto out_err; 1339 goto out_err;
1338 case RPC_PROG_MISMATCH: 1340 case RPC_PROG_MISMATCH:
1339 dprintk("RPC: call_verify: program %u, version %u unsupported by server %s\n", 1341 dprintk("RPC: %5u %s: program %u, version %u unsupported by "
1342 "server %s\n", task->tk_pid, __FUNCTION__,
1340 (unsigned int)task->tk_client->cl_prog, 1343 (unsigned int)task->tk_client->cl_prog,
1341 (unsigned int)task->tk_client->cl_vers, 1344 (unsigned int)task->tk_client->cl_vers,
1342 task->tk_client->cl_server); 1345 task->tk_client->cl_server);
1343 error = -EPROTONOSUPPORT; 1346 error = -EPROTONOSUPPORT;
1344 goto out_err; 1347 goto out_err;
1345 case RPC_PROC_UNAVAIL: 1348 case RPC_PROC_UNAVAIL:
1346 dprintk("RPC: call_verify: proc %p unsupported by program %u, version %u on server %s\n", 1349 dprintk("RPC: %5u %s: proc %p unsupported by program %u, "
1350 "version %u on server %s\n",
1351 task->tk_pid, __FUNCTION__,
1347 task->tk_msg.rpc_proc, 1352 task->tk_msg.rpc_proc,
1348 task->tk_client->cl_prog, 1353 task->tk_client->cl_prog,
1349 task->tk_client->cl_vers, 1354 task->tk_client->cl_vers,
@@ -1351,7 +1356,8 @@ call_verify(struct rpc_task *task)
1351 error = -EOPNOTSUPP; 1356 error = -EOPNOTSUPP;
1352 goto out_err; 1357 goto out_err;
1353 case RPC_GARBAGE_ARGS: 1358 case RPC_GARBAGE_ARGS:
1354 dprintk("RPC: %4d %s: server saw garbage\n", task->tk_pid, __FUNCTION__); 1359 dprintk("RPC: %5u %s: server saw garbage\n",
1360 task->tk_pid, __FUNCTION__);
1355 break; /* retry */ 1361 break; /* retry */
1356 default: 1362 default:
1357 printk(KERN_WARNING "call_verify: server accept status: %x\n", n); 1363 printk(KERN_WARNING "call_verify: server accept status: %x\n", n);
@@ -1362,7 +1368,8 @@ out_garbage:
1362 task->tk_client->cl_stats->rpcgarbage++; 1368 task->tk_client->cl_stats->rpcgarbage++;
1363 if (task->tk_garb_retry) { 1369 if (task->tk_garb_retry) {
1364 task->tk_garb_retry--; 1370 task->tk_garb_retry--;
1365 dprintk("RPC %s: retrying %4d\n", __FUNCTION__, task->tk_pid); 1371 dprintk("RPC: %5u %s: retrying\n",
1372 task->tk_pid, __FUNCTION__);
1366 task->tk_action = call_bind; 1373 task->tk_action = call_bind;
1367out_retry: 1374out_retry:
1368 return ERR_PTR(-EAGAIN); 1375 return ERR_PTR(-EAGAIN);
diff --git a/net/sunrpc/pmap_clnt.c b/net/sunrpc/pmap_clnt.c
index f4e1357bc186..d9f765344589 100644
--- a/net/sunrpc/pmap_clnt.c
+++ b/net/sunrpc/pmap_clnt.c
@@ -62,7 +62,10 @@ static inline void pmap_map_free(struct portmap_args *map)
62 62
63static void pmap_map_release(void *data) 63static void pmap_map_release(void *data)
64{ 64{
65 pmap_map_free(data); 65 struct portmap_args *map = data;
66
67 xprt_put(map->pm_xprt);
68 pmap_map_free(map);
66} 69}
67 70
68static const struct rpc_call_ops pmap_getport_ops = { 71static const struct rpc_call_ops pmap_getport_ops = {
@@ -94,7 +97,7 @@ void rpc_getport(struct rpc_task *task)
94 struct rpc_task *child; 97 struct rpc_task *child;
95 int status; 98 int status;
96 99
97 dprintk("RPC: %4d rpc_getport(%s, %u, %u, %d)\n", 100 dprintk("RPC: %5u rpc_getport(%s, %u, %u, %d)\n",
98 task->tk_pid, clnt->cl_server, 101 task->tk_pid, clnt->cl_server,
99 clnt->cl_prog, clnt->cl_vers, xprt->prot); 102 clnt->cl_prog, clnt->cl_vers, xprt->prot);
100 103
@@ -133,7 +136,7 @@ void rpc_getport(struct rpc_task *task)
133 status = -EIO; 136 status = -EIO;
134 child = rpc_run_task(pmap_clnt, RPC_TASK_ASYNC, &pmap_getport_ops, map); 137 child = rpc_run_task(pmap_clnt, RPC_TASK_ASYNC, &pmap_getport_ops, map);
135 if (IS_ERR(child)) 138 if (IS_ERR(child))
136 goto bailout; 139 goto bailout_nofree;
137 rpc_put_task(child); 140 rpc_put_task(child);
138 141
139 task->tk_xprt->stat.bind_count++; 142 task->tk_xprt->stat.bind_count++;
@@ -175,7 +178,7 @@ int rpc_getport_external(struct sockaddr_in *sin, __u32 prog, __u32 vers, int pr
175 char hostname[32]; 178 char hostname[32];
176 int status; 179 int status;
177 180
178 dprintk("RPC: rpc_getport_external(%u.%u.%u.%u, %u, %u, %d)\n", 181 dprintk("RPC: rpc_getport_external(%u.%u.%u.%u, %u, %u, %d)\n",
179 NIPQUAD(sin->sin_addr.s_addr), prog, vers, prot); 182 NIPQUAD(sin->sin_addr.s_addr), prog, vers, prot);
180 183
181 sprintf(hostname, "%u.%u.%u.%u", NIPQUAD(sin->sin_addr.s_addr)); 184 sprintf(hostname, "%u.%u.%u.%u", NIPQUAD(sin->sin_addr.s_addr));
@@ -218,11 +221,10 @@ static void pmap_getport_done(struct rpc_task *child, void *data)
218 status = 0; 221 status = 0;
219 } 222 }
220 223
221 dprintk("RPC: %4d pmap_getport_done(status %d, port %u)\n", 224 dprintk("RPC: %5u pmap_getport_done(status %d, port %u)\n",
222 child->tk_pid, status, map->pm_port); 225 child->tk_pid, status, map->pm_port);
223 226
224 pmap_wake_portmap_waiters(xprt, status); 227 pmap_wake_portmap_waiters(xprt, status);
225 xprt_put(xprt);
226} 228}
227 229
228/** 230/**
@@ -255,13 +257,14 @@ int rpc_register(u32 prog, u32 vers, int prot, unsigned short port, int *okay)
255 struct rpc_clnt *pmap_clnt; 257 struct rpc_clnt *pmap_clnt;
256 int error = 0; 258 int error = 0;
257 259
258 dprintk("RPC: registering (%u, %u, %d, %u) with portmapper.\n", 260 dprintk("RPC: registering (%u, %u, %d, %u) with portmapper.\n",
259 prog, vers, prot, port); 261 prog, vers, prot, port);
260 262
261 pmap_clnt = pmap_create("localhost", &sin, IPPROTO_UDP, 1); 263 pmap_clnt = pmap_create("localhost", &sin, IPPROTO_UDP, 1);
262 if (IS_ERR(pmap_clnt)) { 264 if (IS_ERR(pmap_clnt)) {
263 error = PTR_ERR(pmap_clnt); 265 error = PTR_ERR(pmap_clnt);
264 dprintk("RPC: couldn't create pmap client. Error = %d\n", error); 266 dprintk("RPC: couldn't create pmap client. Error = %d\n",
267 error);
265 return error; 268 return error;
266 } 269 }
267 270
@@ -272,7 +275,7 @@ int rpc_register(u32 prog, u32 vers, int prot, unsigned short port, int *okay)
272 "RPC: failed to contact portmap (errno %d).\n", 275 "RPC: failed to contact portmap (errno %d).\n",
273 error); 276 error);
274 } 277 }
275 dprintk("RPC: registration status %d/%d\n", error, *okay); 278 dprintk("RPC: registration status %d/%d\n", error, *okay);
276 279
277 /* Client deleted automatically because cl_oneshot == 1 */ 280 /* Client deleted automatically because cl_oneshot == 1 */
278 return error; 281 return error;
@@ -303,8 +306,9 @@ static struct rpc_clnt *pmap_create(char *hostname, struct sockaddr_in *srvaddr,
303 */ 306 */
304static int xdr_encode_mapping(struct rpc_rqst *req, __be32 *p, struct portmap_args *map) 307static int xdr_encode_mapping(struct rpc_rqst *req, __be32 *p, struct portmap_args *map)
305{ 308{
306 dprintk("RPC: xdr_encode_mapping(%u, %u, %u, %u)\n", 309 dprintk("RPC: xdr_encode_mapping(%u, %u, %u, %u)\n",
307 map->pm_prog, map->pm_vers, map->pm_prot, map->pm_port); 310 map->pm_prog, map->pm_vers,
311 map->pm_prot, map->pm_port);
308 *p++ = htonl(map->pm_prog); 312 *p++ = htonl(map->pm_prog);
309 *p++ = htonl(map->pm_vers); 313 *p++ = htonl(map->pm_vers);
310 *p++ = htonl(map->pm_prot); 314 *p++ = htonl(map->pm_prot);
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index e1fad77a2257..9b9ea5045569 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -589,7 +589,7 @@ __rpc_mkdir(struct inode *dir, struct dentry *dentry)
589{ 589{
590 struct inode *inode; 590 struct inode *inode;
591 591
592 inode = rpc_get_inode(dir->i_sb, S_IFDIR | S_IRUSR | S_IXUSR); 592 inode = rpc_get_inode(dir->i_sb, S_IFDIR | S_IRUGO | S_IXUGO);
593 if (!inode) 593 if (!inode)
594 goto out_err; 594 goto out_err;
595 inode->i_ino = iunique(dir->i_sb, 100); 595 inode->i_ino = iunique(dir->i_sb, 100);
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index 54a6b92525ea..6d87320074b1 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -74,7 +74,7 @@ static DEFINE_SPINLOCK(rpc_sched_lock);
74static inline void 74static inline void
75__rpc_disable_timer(struct rpc_task *task) 75__rpc_disable_timer(struct rpc_task *task)
76{ 76{
77 dprintk("RPC: %4d disabling timer\n", task->tk_pid); 77 dprintk("RPC: %5u disabling timer\n", task->tk_pid);
78 task->tk_timeout_fn = NULL; 78 task->tk_timeout_fn = NULL;
79 task->tk_timeout = 0; 79 task->tk_timeout = 0;
80} 80}
@@ -93,7 +93,7 @@ static void rpc_run_timer(struct rpc_task *task)
93 callback = task->tk_timeout_fn; 93 callback = task->tk_timeout_fn;
94 task->tk_timeout_fn = NULL; 94 task->tk_timeout_fn = NULL;
95 if (callback && RPC_IS_QUEUED(task)) { 95 if (callback && RPC_IS_QUEUED(task)) {
96 dprintk("RPC: %4d running timer\n", task->tk_pid); 96 dprintk("RPC: %5u running timer\n", task->tk_pid);
97 callback(task); 97 callback(task);
98 } 98 }
99 smp_mb__before_clear_bit(); 99 smp_mb__before_clear_bit();
@@ -110,7 +110,7 @@ __rpc_add_timer(struct rpc_task *task, rpc_action timer)
110 if (!task->tk_timeout) 110 if (!task->tk_timeout)
111 return; 111 return;
112 112
113 dprintk("RPC: %4d setting alarm for %lu ms\n", 113 dprintk("RPC: %5u setting alarm for %lu ms\n",
114 task->tk_pid, task->tk_timeout * 1000 / HZ); 114 task->tk_pid, task->tk_timeout * 1000 / HZ);
115 115
116 if (timer) 116 if (timer)
@@ -132,7 +132,7 @@ rpc_delete_timer(struct rpc_task *task)
132 return; 132 return;
133 if (test_and_clear_bit(RPC_TASK_HAS_TIMER, &task->tk_runstate)) { 133 if (test_and_clear_bit(RPC_TASK_HAS_TIMER, &task->tk_runstate)) {
134 del_singleshot_timer_sync(&task->tk_timer); 134 del_singleshot_timer_sync(&task->tk_timer);
135 dprintk("RPC: %4d deleting timer\n", task->tk_pid); 135 dprintk("RPC: %5u deleting timer\n", task->tk_pid);
136 } 136 }
137} 137}
138 138
@@ -179,8 +179,8 @@ static void __rpc_add_wait_queue(struct rpc_wait_queue *queue, struct rpc_task *
179 queue->qlen++; 179 queue->qlen++;
180 rpc_set_queued(task); 180 rpc_set_queued(task);
181 181
182 dprintk("RPC: %4d added to queue %p \"%s\"\n", 182 dprintk("RPC: %5u added to queue %p \"%s\"\n",
183 task->tk_pid, queue, rpc_qname(queue)); 183 task->tk_pid, queue, rpc_qname(queue));
184} 184}
185 185
186/* 186/*
@@ -212,8 +212,8 @@ static void __rpc_remove_wait_queue(struct rpc_task *task)
212 else 212 else
213 list_del(&task->u.tk_wait.list); 213 list_del(&task->u.tk_wait.list);
214 queue->qlen--; 214 queue->qlen--;
215 dprintk("RPC: %4d removed from queue %p \"%s\"\n", 215 dprintk("RPC: %5u removed from queue %p \"%s\"\n",
216 task->tk_pid, queue, rpc_qname(queue)); 216 task->tk_pid, queue, rpc_qname(queue));
217} 217}
218 218
219static inline void rpc_set_waitqueue_priority(struct rpc_wait_queue *queue, int priority) 219static inline void rpc_set_waitqueue_priority(struct rpc_wait_queue *queue, int priority)
@@ -344,8 +344,8 @@ static void rpc_make_runnable(struct rpc_task *task)
344static void __rpc_sleep_on(struct rpc_wait_queue *q, struct rpc_task *task, 344static void __rpc_sleep_on(struct rpc_wait_queue *q, struct rpc_task *task,
345 rpc_action action, rpc_action timer) 345 rpc_action action, rpc_action timer)
346{ 346{
347 dprintk("RPC: %4d sleep_on(queue \"%s\" time %ld)\n", task->tk_pid, 347 dprintk("RPC: %5u sleep_on(queue \"%s\" time %lu)\n",
348 rpc_qname(q), jiffies); 348 task->tk_pid, rpc_qname(q), jiffies);
349 349
350 if (!RPC_IS_ASYNC(task) && !RPC_IS_ACTIVATED(task)) { 350 if (!RPC_IS_ASYNC(task) && !RPC_IS_ACTIVATED(task)) {
351 printk(KERN_ERR "RPC: Inactive synchronous task put to sleep!\n"); 351 printk(KERN_ERR "RPC: Inactive synchronous task put to sleep!\n");
@@ -381,7 +381,8 @@ void rpc_sleep_on(struct rpc_wait_queue *q, struct rpc_task *task,
381 */ 381 */
382static void __rpc_do_wake_up_task(struct rpc_task *task) 382static void __rpc_do_wake_up_task(struct rpc_task *task)
383{ 383{
384 dprintk("RPC: %4d __rpc_wake_up_task (now %ld)\n", task->tk_pid, jiffies); 384 dprintk("RPC: %5u __rpc_wake_up_task (now %lu)\n",
385 task->tk_pid, jiffies);
385 386
386#ifdef RPC_DEBUG 387#ifdef RPC_DEBUG
387 BUG_ON(task->tk_magic != RPC_TASK_MAGIC_ID); 388 BUG_ON(task->tk_magic != RPC_TASK_MAGIC_ID);
@@ -397,7 +398,7 @@ static void __rpc_do_wake_up_task(struct rpc_task *task)
397 398
398 rpc_make_runnable(task); 399 rpc_make_runnable(task);
399 400
400 dprintk("RPC: __rpc_wake_up_task done\n"); 401 dprintk("RPC: __rpc_wake_up_task done\n");
401} 402}
402 403
403/* 404/*
@@ -418,7 +419,7 @@ static void __rpc_wake_up_task(struct rpc_task *task)
418static void 419static void
419__rpc_default_timer(struct rpc_task *task) 420__rpc_default_timer(struct rpc_task *task)
420{ 421{
421 dprintk("RPC: %d timeout (default timer)\n", task->tk_pid); 422 dprintk("RPC: %5u timeout (default timer)\n", task->tk_pid);
422 task->tk_status = -ETIMEDOUT; 423 task->tk_status = -ETIMEDOUT;
423 rpc_wake_up_task(task); 424 rpc_wake_up_task(task);
424} 425}
@@ -502,7 +503,8 @@ struct rpc_task * rpc_wake_up_next(struct rpc_wait_queue *queue)
502{ 503{
503 struct rpc_task *task = NULL; 504 struct rpc_task *task = NULL;
504 505
505 dprintk("RPC: wake_up_next(%p \"%s\")\n", queue, rpc_qname(queue)); 506 dprintk("RPC: wake_up_next(%p \"%s\")\n",
507 queue, rpc_qname(queue));
506 rcu_read_lock_bh(); 508 rcu_read_lock_bh();
507 spin_lock(&queue->lock); 509 spin_lock(&queue->lock);
508 if (RPC_IS_PRIORITY(queue)) 510 if (RPC_IS_PRIORITY(queue))
@@ -625,12 +627,12 @@ void rpc_release_calldata(const struct rpc_call_ops *ops, void *calldata)
625/* 627/*
626 * This is the RPC `scheduler' (or rather, the finite state machine). 628 * This is the RPC `scheduler' (or rather, the finite state machine).
627 */ 629 */
628static int __rpc_execute(struct rpc_task *task) 630static void __rpc_execute(struct rpc_task *task)
629{ 631{
630 int status = 0; 632 int status = 0;
631 633
632 dprintk("RPC: %4d rpc_execute flgs %x\n", 634 dprintk("RPC: %5u __rpc_execute flags=0x%x\n",
633 task->tk_pid, task->tk_flags); 635 task->tk_pid, task->tk_flags);
634 636
635 BUG_ON(RPC_IS_QUEUED(task)); 637 BUG_ON(RPC_IS_QUEUED(task));
636 638
@@ -679,14 +681,14 @@ static int __rpc_execute(struct rpc_task *task)
679 if (RPC_IS_ASYNC(task)) { 681 if (RPC_IS_ASYNC(task)) {
680 /* Careful! we may have raced... */ 682 /* Careful! we may have raced... */
681 if (RPC_IS_QUEUED(task)) 683 if (RPC_IS_QUEUED(task))
682 return 0; 684 return;
683 if (rpc_test_and_set_running(task)) 685 if (rpc_test_and_set_running(task))
684 return 0; 686 return;
685 continue; 687 continue;
686 } 688 }
687 689
688 /* sync task: sleep here */ 690 /* sync task: sleep here */
689 dprintk("RPC: %4d sync task going to sleep\n", task->tk_pid); 691 dprintk("RPC: %5u sync task going to sleep\n", task->tk_pid);
690 /* Note: Caller should be using rpc_clnt_sigmask() */ 692 /* Note: Caller should be using rpc_clnt_sigmask() */
691 status = out_of_line_wait_on_bit(&task->tk_runstate, 693 status = out_of_line_wait_on_bit(&task->tk_runstate,
692 RPC_TASK_QUEUED, rpc_wait_bit_interruptible, 694 RPC_TASK_QUEUED, rpc_wait_bit_interruptible,
@@ -698,19 +700,19 @@ static int __rpc_execute(struct rpc_task *task)
698 * clean up after sleeping on some queue, we don't 700 * clean up after sleeping on some queue, we don't
699 * break the loop here, but go around once more. 701 * break the loop here, but go around once more.
700 */ 702 */
701 dprintk("RPC: %4d got signal\n", task->tk_pid); 703 dprintk("RPC: %5u got signal\n", task->tk_pid);
702 task->tk_flags |= RPC_TASK_KILLED; 704 task->tk_flags |= RPC_TASK_KILLED;
703 rpc_exit(task, -ERESTARTSYS); 705 rpc_exit(task, -ERESTARTSYS);
704 rpc_wake_up_task(task); 706 rpc_wake_up_task(task);
705 } 707 }
706 rpc_set_running(task); 708 rpc_set_running(task);
707 dprintk("RPC: %4d sync task resuming\n", task->tk_pid); 709 dprintk("RPC: %5u sync task resuming\n", task->tk_pid);
708 } 710 }
709 711
710 dprintk("RPC: %4d, return %d, status %d\n", task->tk_pid, status, task->tk_status); 712 dprintk("RPC: %5u return %d, status %d\n", task->tk_pid, status,
713 task->tk_status);
711 /* Release all resources associated with the task */ 714 /* Release all resources associated with the task */
712 rpc_release_task(task); 715 rpc_release_task(task);
713 return status;
714} 716}
715 717
716/* 718/*
@@ -722,12 +724,11 @@ static int __rpc_execute(struct rpc_task *task)
722 * released. In particular note that tk_release() will have 724 * released. In particular note that tk_release() will have
723 * been called, so your task memory may have been freed. 725 * been called, so your task memory may have been freed.
724 */ 726 */
725int 727void rpc_execute(struct rpc_task *task)
726rpc_execute(struct rpc_task *task)
727{ 728{
728 rpc_set_active(task); 729 rpc_set_active(task);
729 rpc_set_running(task); 730 rpc_set_running(task);
730 return __rpc_execute(task); 731 __rpc_execute(task);
731} 732}
732 733
733static void rpc_async_schedule(struct work_struct *work) 734static void rpc_async_schedule(struct work_struct *work)
@@ -826,7 +827,7 @@ void rpc_init_task(struct rpc_task *task, struct rpc_clnt *clnt, int flags, cons
826 /* starting timestamp */ 827 /* starting timestamp */
827 task->tk_start = jiffies; 828 task->tk_start = jiffies;
828 829
829 dprintk("RPC: %4d new task procpid %d\n", task->tk_pid, 830 dprintk("RPC: new task initialized, procpid %u\n",
830 current->pid); 831 current->pid);
831} 832}
832 833
@@ -839,7 +840,7 @@ rpc_alloc_task(void)
839static void rpc_free_task(struct rcu_head *rcu) 840static void rpc_free_task(struct rcu_head *rcu)
840{ 841{
841 struct rpc_task *task = container_of(rcu, struct rpc_task, u.tk_rcu); 842 struct rpc_task *task = container_of(rcu, struct rpc_task, u.tk_rcu);
842 dprintk("RPC: %4d freeing task\n", task->tk_pid); 843 dprintk("RPC: %5u freeing task\n", task->tk_pid);
843 mempool_free(task, rpc_task_mempool); 844 mempool_free(task, rpc_task_mempool);
844} 845}
845 846
@@ -858,7 +859,7 @@ struct rpc_task *rpc_new_task(struct rpc_clnt *clnt, int flags, const struct rpc
858 859
859 rpc_init_task(task, clnt, flags, tk_ops, calldata); 860 rpc_init_task(task, clnt, flags, tk_ops, calldata);
860 861
861 dprintk("RPC: %4d allocated task\n", task->tk_pid); 862 dprintk("RPC: allocated task %p\n", task);
862 task->tk_flags |= RPC_TASK_DYNAMIC; 863 task->tk_flags |= RPC_TASK_DYNAMIC;
863out: 864out:
864 return task; 865 return task;
@@ -902,7 +903,7 @@ static void rpc_release_task(struct rpc_task *task)
902#ifdef RPC_DEBUG 903#ifdef RPC_DEBUG
903 BUG_ON(task->tk_magic != RPC_TASK_MAGIC_ID); 904 BUG_ON(task->tk_magic != RPC_TASK_MAGIC_ID);
904#endif 905#endif
905 dprintk("RPC: %4d release task\n", task->tk_pid); 906 dprintk("RPC: %5u release task\n", task->tk_pid);
906 907
907 /* Remove from global task list */ 908 /* Remove from global task list */
908 spin_lock(&rpc_sched_lock); 909 spin_lock(&rpc_sched_lock);
@@ -955,7 +956,7 @@ void rpc_killall_tasks(struct rpc_clnt *clnt)
955 struct rpc_task *rovr; 956 struct rpc_task *rovr;
956 struct list_head *le; 957 struct list_head *le;
957 958
958 dprintk("RPC: killing all tasks for client %p\n", clnt); 959 dprintk("RPC: killing all tasks for client %p\n", clnt);
959 960
960 /* 961 /*
961 * Spin lock all_tasks to prevent changes... 962 * Spin lock all_tasks to prevent changes...
@@ -984,7 +985,8 @@ static void rpciod_killall(void)
984 rpc_killall_tasks(NULL); 985 rpc_killall_tasks(NULL);
985 flush_workqueue(rpciod_workqueue); 986 flush_workqueue(rpciod_workqueue);
986 if (!list_empty(&all_tasks)) { 987 if (!list_empty(&all_tasks)) {
987 dprintk("rpciod_killall: waiting for tasks to exit\n"); 988 dprintk("RPC: rpciod_killall: waiting for tasks "
989 "to exit\n");
988 yield(); 990 yield();
989 } 991 }
990 } 992 }
@@ -1004,7 +1006,7 @@ rpciod_up(void)
1004 int error = 0; 1006 int error = 0;
1005 1007
1006 mutex_lock(&rpciod_mutex); 1008 mutex_lock(&rpciod_mutex);
1007 dprintk("rpciod_up: users %d\n", rpciod_users); 1009 dprintk("RPC: rpciod_up: users %u\n", rpciod_users);
1008 rpciod_users++; 1010 rpciod_users++;
1009 if (rpciod_workqueue) 1011 if (rpciod_workqueue)
1010 goto out; 1012 goto out;
@@ -1012,7 +1014,7 @@ rpciod_up(void)
1012 * If there's no pid, we should be the first user. 1014 * If there's no pid, we should be the first user.
1013 */ 1015 */
1014 if (rpciod_users > 1) 1016 if (rpciod_users > 1)
1015 printk(KERN_WARNING "rpciod_up: no workqueue, %d users??\n", rpciod_users); 1017 printk(KERN_WARNING "rpciod_up: no workqueue, %u users??\n", rpciod_users);
1016 /* 1018 /*
1017 * Create the rpciod thread and wait for it to start. 1019 * Create the rpciod thread and wait for it to start.
1018 */ 1020 */
@@ -1034,7 +1036,7 @@ void
1034rpciod_down(void) 1036rpciod_down(void)
1035{ 1037{
1036 mutex_lock(&rpciod_mutex); 1038 mutex_lock(&rpciod_mutex);
1037 dprintk("rpciod_down sema %d\n", rpciod_users); 1039 dprintk("RPC: rpciod_down sema %u\n", rpciod_users);
1038 if (rpciod_users) { 1040 if (rpciod_users) {
1039 if (--rpciod_users) 1041 if (--rpciod_users)
1040 goto out; 1042 goto out;
@@ -1042,7 +1044,7 @@ rpciod_down(void)
1042 printk(KERN_WARNING "rpciod_down: no users??\n"); 1044 printk(KERN_WARNING "rpciod_down: no users??\n");
1043 1045
1044 if (!rpciod_workqueue) { 1046 if (!rpciod_workqueue) {
1045 dprintk("rpciod_down: Nothing to do!\n"); 1047 dprintk("RPC: rpciod_down: Nothing to do!\n");
1046 goto out; 1048 goto out;
1047 } 1049 }
1048 rpciod_killall(); 1050 rpciod_killall();
@@ -1072,7 +1074,7 @@ void rpc_show_tasks(void)
1072 if (RPC_IS_QUEUED(t)) 1074 if (RPC_IS_QUEUED(t))
1073 rpc_waitq = rpc_qname(t->u.tk_wait.rpc_waitq); 1075 rpc_waitq = rpc_qname(t->u.tk_wait.rpc_waitq);
1074 1076
1075 printk("%05d %04d %04x %06d %8p %6d %8p %08ld %8s %8p %8p\n", 1077 printk("%5u %04d %04x %6d %8p %6d %8p %8ld %8s %8p %8p\n",
1076 t->tk_pid, 1078 t->tk_pid,
1077 (t->tk_msg.rpc_proc ? t->tk_msg.rpc_proc->p_proc : -1), 1079 (t->tk_msg.rpc_proc ? t->tk_msg.rpc_proc->p_proc : -1),
1078 t->tk_flags, t->tk_status, 1080 t->tk_flags, t->tk_status,
diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c
index 044d9484bb8c..74ba7d443dfc 100644
--- a/net/sunrpc/stats.c
+++ b/net/sunrpc/stats.c
@@ -16,7 +16,6 @@
16 16
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/sched.h>
20#include <linux/proc_fs.h> 19#include <linux/proc_fs.h>
21#include <linux/seq_file.h> 20#include <linux/seq_file.h>
22#include <linux/sunrpc/clnt.h> 21#include <linux/sunrpc/clnt.h>
@@ -226,7 +225,7 @@ do_register(const char *name, void *data, const struct file_operations *fops)
226 struct proc_dir_entry *ent; 225 struct proc_dir_entry *ent;
227 226
228 rpc_proc_init(); 227 rpc_proc_init();
229 dprintk("RPC: registering /proc/net/rpc/%s\n", name); 228 dprintk("RPC: registering /proc/net/rpc/%s\n", name);
230 229
231 ent = create_proc_entry(name, 0, proc_net_rpc); 230 ent = create_proc_entry(name, 0, proc_net_rpc);
232 if (ent) { 231 if (ent) {
@@ -263,7 +262,7 @@ svc_proc_unregister(const char *name)
263void 262void
264rpc_proc_init(void) 263rpc_proc_init(void)
265{ 264{
266 dprintk("RPC: registering /proc/net/rpc\n"); 265 dprintk("RPC: registering /proc/net/rpc\n");
267 if (!proc_net_rpc) { 266 if (!proc_net_rpc) {
268 struct proc_dir_entry *ent; 267 struct proc_dir_entry *ent;
269 ent = proc_mkdir("rpc", proc_net); 268 ent = proc_mkdir("rpc", proc_net);
@@ -277,7 +276,7 @@ rpc_proc_init(void)
277void 276void
278rpc_proc_exit(void) 277rpc_proc_exit(void)
279{ 278{
280 dprintk("RPC: unregistering /proc/net/rpc\n"); 279 dprintk("RPC: unregistering /proc/net/rpc\n");
281 if (proc_net_rpc) { 280 if (proc_net_rpc) {
282 proc_net_rpc = NULL; 281 proc_net_rpc = NULL;
283 remove_proc_entry("net/rpc", NULL); 282 remove_proc_entry("net/rpc", NULL);
diff --git a/net/sunrpc/sunrpc_syms.c b/net/sunrpc/sunrpc_syms.c
index d85fddeb6388..43ecf62f12ef 100644
--- a/net/sunrpc/sunrpc_syms.c
+++ b/net/sunrpc/sunrpc_syms.c
@@ -9,7 +9,6 @@
9#include <linux/module.h> 9#include <linux/module.h>
10 10
11#include <linux/types.h> 11#include <linux/types.h>
12#include <linux/sched.h>
13#include <linux/uio.h> 12#include <linux/uio.h>
14#include <linux/unistd.h> 13#include <linux/unistd.h>
15#include <linux/init.h> 14#include <linux/init.h>
@@ -137,7 +136,7 @@ EXPORT_SYMBOL(nlm_debug);
137 136
138extern int register_rpc_pipefs(void); 137extern int register_rpc_pipefs(void);
139extern void unregister_rpc_pipefs(void); 138extern void unregister_rpc_pipefs(void);
140extern struct cache_detail ip_map_cache; 139extern struct cache_detail ip_map_cache, unix_gid_cache;
141extern int init_socket_xprt(void); 140extern int init_socket_xprt(void);
142extern void cleanup_socket_xprt(void); 141extern void cleanup_socket_xprt(void);
143 142
@@ -157,6 +156,7 @@ init_sunrpc(void)
157 rpc_proc_init(); 156 rpc_proc_init();
158#endif 157#endif
159 cache_register(&ip_map_cache); 158 cache_register(&ip_map_cache);
159 cache_register(&unix_gid_cache);
160 init_socket_xprt(); 160 init_socket_xprt();
161out: 161out:
162 return err; 162 return err;
@@ -170,6 +170,8 @@ cleanup_sunrpc(void)
170 rpc_destroy_mempool(); 170 rpc_destroy_mempool();
171 if (cache_unregister(&ip_map_cache)) 171 if (cache_unregister(&ip_map_cache))
172 printk(KERN_ERR "sunrpc: failed to unregister ip_map cache\n"); 172 printk(KERN_ERR "sunrpc: failed to unregister ip_map cache\n");
173 if (cache_unregister(&unix_gid_cache))
174 printk(KERN_ERR "sunrpc: failed to unregister unix_gid cache\n");
173#ifdef RPC_DEBUG 175#ifdef RPC_DEBUG
174 rpc_unregister_sysctl(); 176 rpc_unregister_sysctl();
175#endif 177#endif
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index b00511d39b65..4ab137403e1a 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -317,7 +317,7 @@ __svc_create(struct svc_program *prog, unsigned int bufsize, int npools,
317 for (i = 0; i < serv->sv_nrpools; i++) { 317 for (i = 0; i < serv->sv_nrpools; i++) {
318 struct svc_pool *pool = &serv->sv_pools[i]; 318 struct svc_pool *pool = &serv->sv_pools[i];
319 319
320 dprintk("initialising pool %u for %s\n", 320 dprintk("svc: initialising pool %u for %s\n",
321 i, serv->sv_name); 321 i, serv->sv_name);
322 322
323 pool->sp_id = i; 323 pool->sp_id = i;
@@ -368,7 +368,7 @@ svc_destroy(struct svc_serv *serv)
368{ 368{
369 struct svc_sock *svsk; 369 struct svc_sock *svsk;
370 370
371 dprintk("RPC: svc_destroy(%s, %d)\n", 371 dprintk("svc: svc_destroy(%s, %d)\n",
372 serv->sv_program->pg_name, 372 serv->sv_program->pg_name,
373 serv->sv_nrthreads); 373 serv->sv_nrthreads);
374 374
@@ -654,7 +654,7 @@ svc_register(struct svc_serv *serv, int proto, unsigned short port)
654 if (progp->pg_vers[i] == NULL) 654 if (progp->pg_vers[i] == NULL)
655 continue; 655 continue;
656 656
657 dprintk("RPC: svc_register(%s, %s, %d, %d)%s\n", 657 dprintk("svc: svc_register(%s, %s, %d, %d)%s\n",
658 progp->pg_name, 658 progp->pg_name,
659 proto == IPPROTO_UDP? "udp" : "tcp", 659 proto == IPPROTO_UDP? "udp" : "tcp",
660 port, 660 port,
diff --git a/net/sunrpc/svcauth.c b/net/sunrpc/svcauth.c
index 811a24c83262..f5c3808bf85a 100644
--- a/net/sunrpc/svcauth.c
+++ b/net/sunrpc/svcauth.c
@@ -10,7 +10,6 @@
10 */ 10 */
11 11
12#include <linux/types.h> 12#include <linux/types.h>
13#include <linux/sched.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <linux/sunrpc/types.h> 14#include <linux/sunrpc/types.h>
16#include <linux/sunrpc/xdr.h> 15#include <linux/sunrpc/xdr.h>
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
index 4b775dbf580d..9bae4090254c 100644
--- a/net/sunrpc/svcauth_unix.c
+++ b/net/sunrpc/svcauth_unix.c
@@ -418,6 +418,214 @@ svcauth_unix_info_release(void *info)
418 cache_put(&ipm->h, &ip_map_cache); 418 cache_put(&ipm->h, &ip_map_cache);
419} 419}
420 420
421/****************************************************************************
422 * auth.unix.gid cache
423 * simple cache to map a UID to a list of GIDs
424 * because AUTH_UNIX aka AUTH_SYS has a max of 16
425 */
426#define GID_HASHBITS 8
427#define GID_HASHMAX (1<<GID_HASHBITS)
428#define GID_HASHMASK (GID_HASHMAX - 1)
429
430struct unix_gid {
431 struct cache_head h;
432 uid_t uid;
433 struct group_info *gi;
434};
435static struct cache_head *gid_table[GID_HASHMAX];
436
437static void unix_gid_put(struct kref *kref)
438{
439 struct cache_head *item = container_of(kref, struct cache_head, ref);
440 struct unix_gid *ug = container_of(item, struct unix_gid, h);
441 if (test_bit(CACHE_VALID, &item->flags) &&
442 !test_bit(CACHE_NEGATIVE, &item->flags))
443 put_group_info(ug->gi);
444 kfree(ug);
445}
446
447static int unix_gid_match(struct cache_head *corig, struct cache_head *cnew)
448{
449 struct unix_gid *orig = container_of(corig, struct unix_gid, h);
450 struct unix_gid *new = container_of(cnew, struct unix_gid, h);
451 return orig->uid == new->uid;
452}
453static void unix_gid_init(struct cache_head *cnew, struct cache_head *citem)
454{
455 struct unix_gid *new = container_of(cnew, struct unix_gid, h);
456 struct unix_gid *item = container_of(citem, struct unix_gid, h);
457 new->uid = item->uid;
458}
459static void unix_gid_update(struct cache_head *cnew, struct cache_head *citem)
460{
461 struct unix_gid *new = container_of(cnew, struct unix_gid, h);
462 struct unix_gid *item = container_of(citem, struct unix_gid, h);
463
464 get_group_info(item->gi);
465 new->gi = item->gi;
466}
467static struct cache_head *unix_gid_alloc(void)
468{
469 struct unix_gid *g = kmalloc(sizeof(*g), GFP_KERNEL);
470 if (g)
471 return &g->h;
472 else
473 return NULL;
474}
475
476static void unix_gid_request(struct cache_detail *cd,
477 struct cache_head *h,
478 char **bpp, int *blen)
479{
480 char tuid[20];
481 struct unix_gid *ug = container_of(h, struct unix_gid, h);
482
483 snprintf(tuid, 20, "%u", ug->uid);
484 qword_add(bpp, blen, tuid);
485 (*bpp)[-1] = '\n';
486}
487
488static struct unix_gid *unix_gid_lookup(uid_t uid);
489extern struct cache_detail unix_gid_cache;
490
491static int unix_gid_parse(struct cache_detail *cd,
492 char *mesg, int mlen)
493{
494 /* uid expiry Ngid gid0 gid1 ... gidN-1 */
495 int uid;
496 int gids;
497 int rv;
498 int i;
499 int err;
500 time_t expiry;
501 struct unix_gid ug, *ugp;
502
503 if (mlen <= 0 || mesg[mlen-1] != '\n')
504 return -EINVAL;
505 mesg[mlen-1] = 0;
506
507 rv = get_int(&mesg, &uid);
508 if (rv)
509 return -EINVAL;
510 ug.uid = uid;
511
512 expiry = get_expiry(&mesg);
513 if (expiry == 0)
514 return -EINVAL;
515
516 rv = get_int(&mesg, &gids);
517 if (rv || gids < 0 || gids > 8192)
518 return -EINVAL;
519
520 ug.gi = groups_alloc(gids);
521 if (!ug.gi)
522 return -ENOMEM;
523
524 for (i = 0 ; i < gids ; i++) {
525 int gid;
526 rv = get_int(&mesg, &gid);
527 err = -EINVAL;
528 if (rv)
529 goto out;
530 GROUP_AT(ug.gi, i) = gid;
531 }
532
533 ugp = unix_gid_lookup(uid);
534 if (ugp) {
535 struct cache_head *ch;
536 ug.h.flags = 0;
537 ug.h.expiry_time = expiry;
538 ch = sunrpc_cache_update(&unix_gid_cache,
539 &ug.h, &ugp->h,
540 hash_long(uid, GID_HASHBITS));
541 if (!ch)
542 err = -ENOMEM;
543 else {
544 err = 0;
545 cache_put(ch, &unix_gid_cache);
546 }
547 } else
548 err = -ENOMEM;
549 out:
550 if (ug.gi)
551 put_group_info(ug.gi);
552 return err;
553}
554
555static int unix_gid_show(struct seq_file *m,
556 struct cache_detail *cd,
557 struct cache_head *h)
558{
559 struct unix_gid *ug;
560 int i;
561 int glen;
562
563 if (h == NULL) {
564 seq_puts(m, "#uid cnt: gids...\n");
565 return 0;
566 }
567 ug = container_of(h, struct unix_gid, h);
568 if (test_bit(CACHE_VALID, &h->flags) &&
569 !test_bit(CACHE_NEGATIVE, &h->flags))
570 glen = ug->gi->ngroups;
571 else
572 glen = 0;
573
574 seq_printf(m, "%d %d:", ug->uid, glen);
575 for (i = 0; i < glen; i++)
576 seq_printf(m, " %d", GROUP_AT(ug->gi, i));
577 seq_printf(m, "\n");
578 return 0;
579}
580
581struct cache_detail unix_gid_cache = {
582 .owner = THIS_MODULE,
583 .hash_size = GID_HASHMAX,
584 .hash_table = gid_table,
585 .name = "auth.unix.gid",
586 .cache_put = unix_gid_put,
587 .cache_request = unix_gid_request,
588 .cache_parse = unix_gid_parse,
589 .cache_show = unix_gid_show,
590 .match = unix_gid_match,
591 .init = unix_gid_init,
592 .update = unix_gid_update,
593 .alloc = unix_gid_alloc,
594};
595
596static struct unix_gid *unix_gid_lookup(uid_t uid)
597{
598 struct unix_gid ug;
599 struct cache_head *ch;
600
601 ug.uid = uid;
602 ch = sunrpc_cache_lookup(&unix_gid_cache, &ug.h,
603 hash_long(uid, GID_HASHBITS));
604 if (ch)
605 return container_of(ch, struct unix_gid, h);
606 else
607 return NULL;
608}
609
610static int unix_gid_find(uid_t uid, struct group_info **gip,
611 struct svc_rqst *rqstp)
612{
613 struct unix_gid *ug = unix_gid_lookup(uid);
614 if (!ug)
615 return -EAGAIN;
616 switch (cache_check(&unix_gid_cache, &ug->h, &rqstp->rq_chandle)) {
617 case -ENOENT:
618 *gip = NULL;
619 return 0;
620 case 0:
621 *gip = ug->gi;
622 get_group_info(*gip);
623 return 0;
624 default:
625 return -EAGAIN;
626 }
627}
628
421static int 629static int
422svcauth_unix_set_client(struct svc_rqst *rqstp) 630svcauth_unix_set_client(struct svc_rqst *rqstp)
423{ 631{
@@ -543,12 +751,19 @@ svcauth_unix_accept(struct svc_rqst *rqstp, __be32 *authp)
543 slen = svc_getnl(argv); /* gids length */ 751 slen = svc_getnl(argv); /* gids length */
544 if (slen > 16 || (len -= (slen + 2)*4) < 0) 752 if (slen > 16 || (len -= (slen + 2)*4) < 0)
545 goto badcred; 753 goto badcred;
546 cred->cr_group_info = groups_alloc(slen); 754 if (unix_gid_find(cred->cr_uid, &cred->cr_group_info, rqstp)
547 if (cred->cr_group_info == NULL) 755 == -EAGAIN)
548 return SVC_DROP; 756 return SVC_DROP;
549 for (i = 0; i < slen; i++) 757 if (cred->cr_group_info == NULL) {
550 GROUP_AT(cred->cr_group_info, i) = svc_getnl(argv); 758 cred->cr_group_info = groups_alloc(slen);
551 759 if (cred->cr_group_info == NULL)
760 return SVC_DROP;
761 for (i = 0; i < slen; i++)
762 GROUP_AT(cred->cr_group_info, i) = svc_getnl(argv);
763 } else {
764 for (i = 0; i < slen ; i++)
765 svc_getnl(argv);
766 }
552 if (svc_getu32(argv) != htonl(RPC_AUTH_NULL) || svc_getu32(argv) != 0) { 767 if (svc_getu32(argv) != htonl(RPC_AUTH_NULL) || svc_getu32(argv) != 0) {
553 *authp = rpc_autherr_badverf; 768 *authp = rpc_autherr_badverf;
554 return SVC_DENIED; 769 return SVC_DENIED;
diff --git a/net/sunrpc/sysctl.c b/net/sunrpc/sysctl.c
index 47d8df2b5eb2..738db32a287d 100644
--- a/net/sunrpc/sysctl.c
+++ b/net/sunrpc/sysctl.c
@@ -35,14 +35,8 @@ static ctl_table sunrpc_table[];
35void 35void
36rpc_register_sysctl(void) 36rpc_register_sysctl(void)
37{ 37{
38 if (!sunrpc_table_header) { 38 if (!sunrpc_table_header)
39 sunrpc_table_header = register_sysctl_table(sunrpc_table, 1); 39 sunrpc_table_header = register_sysctl_table(sunrpc_table);
40#ifdef CONFIG_PROC_FS
41 if (sunrpc_table[0].de)
42 sunrpc_table[0].de->owner = THIS_MODULE;
43#endif
44 }
45
46} 40}
47 41
48void 42void
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index e7c71a1ea3d4..ee6ffa01dfb1 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -108,7 +108,7 @@ int xprt_reserve_xprt(struct rpc_task *task)
108 return 1; 108 return 1;
109 109
110out_sleep: 110out_sleep:
111 dprintk("RPC: %4d failed to lock transport %p\n", 111 dprintk("RPC: %5u failed to lock transport %p\n",
112 task->tk_pid, xprt); 112 task->tk_pid, xprt);
113 task->tk_timeout = 0; 113 task->tk_timeout = 0;
114 task->tk_status = -EAGAIN; 114 task->tk_status = -EAGAIN;
@@ -158,7 +158,7 @@ int xprt_reserve_xprt_cong(struct rpc_task *task)
158 } 158 }
159 xprt_clear_locked(xprt); 159 xprt_clear_locked(xprt);
160out_sleep: 160out_sleep:
161 dprintk("RPC: %4d failed to lock transport %p\n", task->tk_pid, xprt); 161 dprintk("RPC: %5u failed to lock transport %p\n", task->tk_pid, xprt);
162 task->tk_timeout = 0; 162 task->tk_timeout = 0;
163 task->tk_status = -EAGAIN; 163 task->tk_status = -EAGAIN;
164 if (req && req->rq_ntrans) 164 if (req && req->rq_ntrans)
@@ -281,7 +281,7 @@ __xprt_get_cong(struct rpc_xprt *xprt, struct rpc_task *task)
281 281
282 if (req->rq_cong) 282 if (req->rq_cong)
283 return 1; 283 return 1;
284 dprintk("RPC: %4d xprt_cwnd_limited cong = %ld cwnd = %ld\n", 284 dprintk("RPC: %5u xprt_cwnd_limited cong = %lu cwnd = %lu\n",
285 task->tk_pid, xprt->cong, xprt->cwnd); 285 task->tk_pid, xprt->cong, xprt->cwnd);
286 if (RPCXPRT_CONGESTED(xprt)) 286 if (RPCXPRT_CONGESTED(xprt))
287 return 0; 287 return 0;
@@ -340,7 +340,7 @@ void xprt_adjust_cwnd(struct rpc_task *task, int result)
340 if (cwnd < RPC_CWNDSCALE) 340 if (cwnd < RPC_CWNDSCALE)
341 cwnd = RPC_CWNDSCALE; 341 cwnd = RPC_CWNDSCALE;
342 } 342 }
343 dprintk("RPC: cong %ld, cwnd was %ld, now %ld\n", 343 dprintk("RPC: cong %ld, cwnd was %ld, now %ld\n",
344 xprt->cong, xprt->cwnd, cwnd); 344 xprt->cong, xprt->cwnd, cwnd);
345 xprt->cwnd = cwnd; 345 xprt->cwnd = cwnd;
346 __xprt_put_cong(xprt, req); 346 __xprt_put_cong(xprt, req);
@@ -387,8 +387,8 @@ void xprt_write_space(struct rpc_xprt *xprt)
387 387
388 spin_lock_bh(&xprt->transport_lock); 388 spin_lock_bh(&xprt->transport_lock);
389 if (xprt->snd_task) { 389 if (xprt->snd_task) {
390 dprintk("RPC: write space: waking waiting task on xprt %p\n", 390 dprintk("RPC: write space: waking waiting task on "
391 xprt); 391 "xprt %p\n", xprt);
392 rpc_wake_up_task(xprt->snd_task); 392 rpc_wake_up_task(xprt->snd_task);
393 } 393 }
394 spin_unlock_bh(&xprt->transport_lock); 394 spin_unlock_bh(&xprt->transport_lock);
@@ -494,7 +494,7 @@ static void xprt_autoclose(struct work_struct *work)
494 */ 494 */
495void xprt_disconnect(struct rpc_xprt *xprt) 495void xprt_disconnect(struct rpc_xprt *xprt)
496{ 496{
497 dprintk("RPC: disconnected transport %p\n", xprt); 497 dprintk("RPC: disconnected transport %p\n", xprt);
498 spin_lock_bh(&xprt->transport_lock); 498 spin_lock_bh(&xprt->transport_lock);
499 xprt_clear_connected(xprt); 499 xprt_clear_connected(xprt);
500 xprt_wake_pending_tasks(xprt, -ENOTCONN); 500 xprt_wake_pending_tasks(xprt, -ENOTCONN);
@@ -530,7 +530,7 @@ void xprt_connect(struct rpc_task *task)
530{ 530{
531 struct rpc_xprt *xprt = task->tk_xprt; 531 struct rpc_xprt *xprt = task->tk_xprt;
532 532
533 dprintk("RPC: %4d xprt_connect xprt %p %s connected\n", task->tk_pid, 533 dprintk("RPC: %5u xprt_connect xprt %p %s connected\n", task->tk_pid,
534 xprt, (xprt_connected(xprt) ? "is" : "is not")); 534 xprt, (xprt_connected(xprt) ? "is" : "is not"));
535 535
536 if (!xprt_bound(xprt)) { 536 if (!xprt_bound(xprt)) {
@@ -560,7 +560,7 @@ static void xprt_connect_status(struct rpc_task *task)
560 if (task->tk_status >= 0) { 560 if (task->tk_status >= 0) {
561 xprt->stat.connect_count++; 561 xprt->stat.connect_count++;
562 xprt->stat.connect_time += (long)jiffies - xprt->stat.connect_start; 562 xprt->stat.connect_time += (long)jiffies - xprt->stat.connect_start;
563 dprintk("RPC: %4d xprt_connect_status: connection established\n", 563 dprintk("RPC: %5u xprt_connect_status: connection established\n",
564 task->tk_pid); 564 task->tk_pid);
565 return; 565 return;
566 } 566 }
@@ -568,20 +568,22 @@ static void xprt_connect_status(struct rpc_task *task)
568 switch (task->tk_status) { 568 switch (task->tk_status) {
569 case -ECONNREFUSED: 569 case -ECONNREFUSED:
570 case -ECONNRESET: 570 case -ECONNRESET:
571 dprintk("RPC: %4d xprt_connect_status: server %s refused connection\n", 571 dprintk("RPC: %5u xprt_connect_status: server %s refused "
572 task->tk_pid, task->tk_client->cl_server); 572 "connection\n", task->tk_pid,
573 task->tk_client->cl_server);
573 break; 574 break;
574 case -ENOTCONN: 575 case -ENOTCONN:
575 dprintk("RPC: %4d xprt_connect_status: connection broken\n", 576 dprintk("RPC: %5u xprt_connect_status: connection broken\n",
576 task->tk_pid); 577 task->tk_pid);
577 break; 578 break;
578 case -ETIMEDOUT: 579 case -ETIMEDOUT:
579 dprintk("RPC: %4d xprt_connect_status: connect attempt timed out\n", 580 dprintk("RPC: %5u xprt_connect_status: connect attempt timed "
580 task->tk_pid); 581 "out\n", task->tk_pid);
581 break; 582 break;
582 default: 583 default:
583 dprintk("RPC: %4d xprt_connect_status: error %d connecting to server %s\n", 584 dprintk("RPC: %5u xprt_connect_status: error %d connecting to "
584 task->tk_pid, -task->tk_status, task->tk_client->cl_server); 585 "server %s\n", task->tk_pid, -task->tk_status,
586 task->tk_client->cl_server);
585 xprt_release_write(xprt, task); 587 xprt_release_write(xprt, task);
586 task->tk_status = -EIO; 588 task->tk_status = -EIO;
587 } 589 }
@@ -602,6 +604,9 @@ struct rpc_rqst *xprt_lookup_rqst(struct rpc_xprt *xprt, __be32 xid)
602 if (entry->rq_xid == xid) 604 if (entry->rq_xid == xid)
603 return entry; 605 return entry;
604 } 606 }
607
608 dprintk("RPC: xprt_lookup_rqst did not find xid %08x\n",
609 ntohl(xid));
605 xprt->stat.bad_xids++; 610 xprt->stat.bad_xids++;
606 return NULL; 611 return NULL;
607} 612}
@@ -654,7 +659,7 @@ static void xprt_timer(struct rpc_task *task)
654 struct rpc_rqst *req = task->tk_rqstp; 659 struct rpc_rqst *req = task->tk_rqstp;
655 struct rpc_xprt *xprt = req->rq_xprt; 660 struct rpc_xprt *xprt = req->rq_xprt;
656 661
657 dprintk("RPC: %4d xprt_timer\n", task->tk_pid); 662 dprintk("RPC: %5u xprt_timer\n", task->tk_pid);
658 663
659 spin_lock(&xprt->transport_lock); 664 spin_lock(&xprt->transport_lock);
660 if (!req->rq_received) { 665 if (!req->rq_received) {
@@ -678,7 +683,7 @@ int xprt_prepare_transmit(struct rpc_task *task)
678 struct rpc_xprt *xprt = req->rq_xprt; 683 struct rpc_xprt *xprt = req->rq_xprt;
679 int err = 0; 684 int err = 0;
680 685
681 dprintk("RPC: %4d xprt_prepare_transmit\n", task->tk_pid); 686 dprintk("RPC: %5u xprt_prepare_transmit\n", task->tk_pid);
682 687
683 spin_lock_bh(&xprt->transport_lock); 688 spin_lock_bh(&xprt->transport_lock);
684 if (req->rq_received && !req->rq_bytes_sent) { 689 if (req->rq_received && !req->rq_bytes_sent) {
@@ -716,7 +721,7 @@ void xprt_transmit(struct rpc_task *task)
716 struct rpc_xprt *xprt = req->rq_xprt; 721 struct rpc_xprt *xprt = req->rq_xprt;
717 int status; 722 int status;
718 723
719 dprintk("RPC: %4d xprt_transmit(%u)\n", task->tk_pid, req->rq_slen); 724 dprintk("RPC: %5u xprt_transmit(%u)\n", task->tk_pid, req->rq_slen);
720 725
721 if (!req->rq_received) { 726 if (!req->rq_received) {
722 if (list_empty(&req->rq_list)) { 727 if (list_empty(&req->rq_list)) {
@@ -730,13 +735,23 @@ void xprt_transmit(struct rpc_task *task)
730 xprt_reset_majortimeo(req); 735 xprt_reset_majortimeo(req);
731 /* Turn off autodisconnect */ 736 /* Turn off autodisconnect */
732 del_singleshot_timer_sync(&xprt->timer); 737 del_singleshot_timer_sync(&xprt->timer);
738 } else {
739 /* If all request bytes have been sent,
740 * then we must be retransmitting this one */
741 if (!req->rq_bytes_sent) {
742 if (task->tk_client->cl_discrtry) {
743 xprt_disconnect(xprt);
744 task->tk_status = -ENOTCONN;
745 return;
746 }
747 }
733 } 748 }
734 } else if (!req->rq_bytes_sent) 749 } else if (!req->rq_bytes_sent)
735 return; 750 return;
736 751
737 status = xprt->ops->send_request(task); 752 status = xprt->ops->send_request(task);
738 if (status == 0) { 753 if (status == 0) {
739 dprintk("RPC: %4d xmit complete\n", task->tk_pid); 754 dprintk("RPC: %5u xmit complete\n", task->tk_pid);
740 spin_lock_bh(&xprt->transport_lock); 755 spin_lock_bh(&xprt->transport_lock);
741 756
742 xprt->ops->set_retrans_timeout(task); 757 xprt->ops->set_retrans_timeout(task);
@@ -777,7 +792,7 @@ static inline void do_xprt_reserve(struct rpc_task *task)
777 xprt_request_init(task, xprt); 792 xprt_request_init(task, xprt);
778 return; 793 return;
779 } 794 }
780 dprintk("RPC: waiting for request slot\n"); 795 dprintk("RPC: waiting for request slot\n");
781 task->tk_status = -EAGAIN; 796 task->tk_status = -EAGAIN;
782 task->tk_timeout = 0; 797 task->tk_timeout = 0;
783 rpc_sleep_on(&xprt->backlog, task, NULL, NULL); 798 rpc_sleep_on(&xprt->backlog, task, NULL, NULL);
@@ -822,7 +837,7 @@ static void xprt_request_init(struct rpc_task *task, struct rpc_xprt *xprt)
822 req->rq_xid = xprt_alloc_xid(xprt); 837 req->rq_xid = xprt_alloc_xid(xprt);
823 req->rq_release_snd_buf = NULL; 838 req->rq_release_snd_buf = NULL;
824 xprt_reset_majortimeo(req); 839 xprt_reset_majortimeo(req);
825 dprintk("RPC: %4d reserved req %p xid %08x\n", task->tk_pid, 840 dprintk("RPC: %5u reserved req %p xid %08x\n", task->tk_pid,
826 req, ntohl(req->rq_xid)); 841 req, ntohl(req->rq_xid));
827} 842}
828 843
@@ -856,7 +871,7 @@ void xprt_release(struct rpc_task *task)
856 req->rq_release_snd_buf(req); 871 req->rq_release_snd_buf(req);
857 memset(req, 0, sizeof(*req)); /* mark unused */ 872 memset(req, 0, sizeof(*req)); /* mark unused */
858 873
859 dprintk("RPC: %4d release request %p\n", task->tk_pid, req); 874 dprintk("RPC: %5u release request %p\n", task->tk_pid, req);
860 875
861 spin_lock(&xprt->reserve_lock); 876 spin_lock(&xprt->reserve_lock);
862 list_add(&req->rq_list, &xprt->free); 877 list_add(&req->rq_list, &xprt->free);
@@ -906,7 +921,7 @@ struct rpc_xprt *xprt_create_transport(int proto, struct sockaddr *ap, size_t si
906 return ERR_PTR(-EIO); 921 return ERR_PTR(-EIO);
907 } 922 }
908 if (IS_ERR(xprt)) { 923 if (IS_ERR(xprt)) {
909 dprintk("RPC: xprt_create_transport: failed, %ld\n", 924 dprintk("RPC: xprt_create_transport: failed, %ld\n",
910 -PTR_ERR(xprt)); 925 -PTR_ERR(xprt));
911 return xprt; 926 return xprt;
912 } 927 }
@@ -936,7 +951,7 @@ struct rpc_xprt *xprt_create_transport(int proto, struct sockaddr *ap, size_t si
936 951
937 xprt_init_xid(xprt); 952 xprt_init_xid(xprt);
938 953
939 dprintk("RPC: created transport %p with %u slots\n", xprt, 954 dprintk("RPC: created transport %p with %u slots\n", xprt,
940 xprt->max_reqs); 955 xprt->max_reqs);
941 956
942 return xprt; 957 return xprt;
@@ -951,7 +966,7 @@ static void xprt_destroy(struct kref *kref)
951{ 966{
952 struct rpc_xprt *xprt = container_of(kref, struct rpc_xprt, kref); 967 struct rpc_xprt *xprt = container_of(kref, struct rpc_xprt, kref);
953 968
954 dprintk("RPC: destroying transport %p\n", xprt); 969 dprintk("RPC: destroying transport %p\n", xprt);
955 xprt->shutdown = 1; 970 xprt->shutdown = 1;
956 del_timer_sync(&xprt->timer); 971 del_timer_sync(&xprt->timer);
957 972
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 49cabffd7fdb..a5a32029e728 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -18,7 +18,6 @@
18#include <linux/types.h> 18#include <linux/types.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
20#include <linux/capability.h> 20#include <linux/capability.h>
21#include <linux/sched.h>
22#include <linux/pagemap.h> 21#include <linux/pagemap.h>
23#include <linux/errno.h> 22#include <linux/errno.h>
24#include <linux/socket.h> 23#include <linux/socket.h>
@@ -192,7 +191,7 @@ static void xs_pktdump(char *msg, u32 *packet, unsigned int count)
192 u8 *buf = (u8 *) packet; 191 u8 *buf = (u8 *) packet;
193 int j; 192 int j;
194 193
195 dprintk("RPC: %s\n", msg); 194 dprintk("RPC: %s\n", msg);
196 for (j = 0; j < count && j < 128; j += 4) { 195 for (j = 0; j < count && j < 128; j += 4) {
197 if (!(j & 31)) { 196 if (!(j & 31)) {
198 if (j) 197 if (j)
@@ -418,7 +417,7 @@ static void xs_nospace(struct rpc_task *task)
418 struct rpc_xprt *xprt = req->rq_xprt; 417 struct rpc_xprt *xprt = req->rq_xprt;
419 struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); 418 struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);
420 419
421 dprintk("RPC: %4d xmit incomplete (%u left of %u)\n", 420 dprintk("RPC: %5u xmit incomplete (%u left of %u)\n",
422 task->tk_pid, req->rq_slen - req->rq_bytes_sent, 421 task->tk_pid, req->rq_slen - req->rq_bytes_sent,
423 req->rq_slen); 422 req->rq_slen);
424 423
@@ -467,7 +466,7 @@ static int xs_udp_send_request(struct rpc_task *task)
467 xprt->addrlen, xdr, 466 xprt->addrlen, xdr,
468 req->rq_bytes_sent); 467 req->rq_bytes_sent);
469 468
470 dprintk("RPC: xs_udp_send_request(%u) = %d\n", 469 dprintk("RPC: xs_udp_send_request(%u) = %d\n",
471 xdr->len - req->rq_bytes_sent, status); 470 xdr->len - req->rq_bytes_sent, status);
472 471
473 if (likely(status >= (int) req->rq_slen)) 472 if (likely(status >= (int) req->rq_slen))
@@ -488,7 +487,7 @@ static int xs_udp_send_request(struct rpc_task *task)
488 xs_nospace(task); 487 xs_nospace(task);
489 break; 488 break;
490 default: 489 default:
491 dprintk("RPC: sendmsg returned unrecognized error %d\n", 490 dprintk("RPC: sendmsg returned unrecognized error %d\n",
492 -status); 491 -status);
493 break; 492 break;
494 } 493 }
@@ -539,7 +538,7 @@ static int xs_tcp_send_request(struct rpc_task *task)
539 status = xs_sendpages(transport->sock, 538 status = xs_sendpages(transport->sock,
540 NULL, 0, xdr, req->rq_bytes_sent); 539 NULL, 0, xdr, req->rq_bytes_sent);
541 540
542 dprintk("RPC: xs_tcp_send_request(%u) = %d\n", 541 dprintk("RPC: xs_tcp_send_request(%u) = %d\n",
543 xdr->len - req->rq_bytes_sent, status); 542 xdr->len - req->rq_bytes_sent, status);
544 543
545 if (unlikely(status < 0)) 544 if (unlikely(status < 0))
@@ -570,7 +569,7 @@ static int xs_tcp_send_request(struct rpc_task *task)
570 status = -ENOTCONN; 569 status = -ENOTCONN;
571 break; 570 break;
572 default: 571 default:
573 dprintk("RPC: sendmsg returned unrecognized error %d\n", 572 dprintk("RPC: sendmsg returned unrecognized error %d\n",
574 -status); 573 -status);
575 xprt_disconnect(xprt); 574 xprt_disconnect(xprt);
576 break; 575 break;
@@ -622,7 +621,7 @@ static void xs_close(struct rpc_xprt *xprt)
622 if (!sk) 621 if (!sk)
623 goto clear_close_wait; 622 goto clear_close_wait;
624 623
625 dprintk("RPC: xs_close xprt %p\n", xprt); 624 dprintk("RPC: xs_close xprt %p\n", xprt);
626 625
627 write_lock_bh(&sk->sk_callback_lock); 626 write_lock_bh(&sk->sk_callback_lock);
628 transport->inet = NULL; 627 transport->inet = NULL;
@@ -652,7 +651,7 @@ static void xs_destroy(struct rpc_xprt *xprt)
652{ 651{
653 struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); 652 struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);
654 653
655 dprintk("RPC: xs_destroy xprt %p\n", xprt); 654 dprintk("RPC: xs_destroy xprt %p\n", xprt);
656 655
657 cancel_delayed_work(&transport->connect_worker); 656 cancel_delayed_work(&transport->connect_worker);
658 flush_scheduled_work(); 657 flush_scheduled_work();
@@ -686,7 +685,7 @@ static void xs_udp_data_ready(struct sock *sk, int len)
686 __be32 *xp; 685 __be32 *xp;
687 686
688 read_lock(&sk->sk_callback_lock); 687 read_lock(&sk->sk_callback_lock);
689 dprintk("RPC: xs_udp_data_ready...\n"); 688 dprintk("RPC: xs_udp_data_ready...\n");
690 if (!(xprt = xprt_from_sock(sk))) 689 if (!(xprt = xprt_from_sock(sk)))
691 goto out; 690 goto out;
692 691
@@ -698,7 +697,7 @@ static void xs_udp_data_ready(struct sock *sk, int len)
698 697
699 repsize = skb->len - sizeof(struct udphdr); 698 repsize = skb->len - sizeof(struct udphdr);
700 if (repsize < 4) { 699 if (repsize < 4) {
701 dprintk("RPC: impossible RPC reply size %d!\n", repsize); 700 dprintk("RPC: impossible RPC reply size %d!\n", repsize);
702 goto dropit; 701 goto dropit;
703 } 702 }
704 703
@@ -762,11 +761,11 @@ static inline void xs_tcp_read_fraghdr(struct rpc_xprt *xprt, struct xdr_skb_rea
762 761
763 /* Sanity check of the record length */ 762 /* Sanity check of the record length */
764 if (unlikely(transport->tcp_reclen < 4)) { 763 if (unlikely(transport->tcp_reclen < 4)) {
765 dprintk("RPC: invalid TCP record fragment length\n"); 764 dprintk("RPC: invalid TCP record fragment length\n");
766 xprt_disconnect(xprt); 765 xprt_disconnect(xprt);
767 return; 766 return;
768 } 767 }
769 dprintk("RPC: reading TCP record fragment of length %d\n", 768 dprintk("RPC: reading TCP record fragment of length %d\n",
770 transport->tcp_reclen); 769 transport->tcp_reclen);
771} 770}
772 771
@@ -789,7 +788,7 @@ static inline void xs_tcp_read_xid(struct sock_xprt *transport, struct xdr_skb_r
789 char *p; 788 char *p;
790 789
791 len = sizeof(transport->tcp_xid) - transport->tcp_offset; 790 len = sizeof(transport->tcp_xid) - transport->tcp_offset;
792 dprintk("RPC: reading XID (%Zu bytes)\n", len); 791 dprintk("RPC: reading XID (%Zu bytes)\n", len);
793 p = ((char *) &transport->tcp_xid) + transport->tcp_offset; 792 p = ((char *) &transport->tcp_xid) + transport->tcp_offset;
794 used = xdr_skb_read_bits(desc, p, len); 793 used = xdr_skb_read_bits(desc, p, len);
795 transport->tcp_offset += used; 794 transport->tcp_offset += used;
@@ -798,7 +797,7 @@ static inline void xs_tcp_read_xid(struct sock_xprt *transport, struct xdr_skb_r
798 transport->tcp_flags &= ~TCP_RCV_COPY_XID; 797 transport->tcp_flags &= ~TCP_RCV_COPY_XID;
799 transport->tcp_flags |= TCP_RCV_COPY_DATA; 798 transport->tcp_flags |= TCP_RCV_COPY_DATA;
800 transport->tcp_copied = 4; 799 transport->tcp_copied = 4;
801 dprintk("RPC: reading reply for XID %08x\n", 800 dprintk("RPC: reading reply for XID %08x\n",
802 ntohl(transport->tcp_xid)); 801 ntohl(transport->tcp_xid));
803 xs_tcp_check_fraghdr(transport); 802 xs_tcp_check_fraghdr(transport);
804} 803}
@@ -816,7 +815,7 @@ static inline void xs_tcp_read_request(struct rpc_xprt *xprt, struct xdr_skb_rea
816 req = xprt_lookup_rqst(xprt, transport->tcp_xid); 815 req = xprt_lookup_rqst(xprt, transport->tcp_xid);
817 if (!req) { 816 if (!req) {
818 transport->tcp_flags &= ~TCP_RCV_COPY_DATA; 817 transport->tcp_flags &= ~TCP_RCV_COPY_DATA;
819 dprintk("RPC: XID %08x request not found!\n", 818 dprintk("RPC: XID %08x request not found!\n",
820 ntohl(transport->tcp_xid)); 819 ntohl(transport->tcp_xid));
821 spin_unlock(&xprt->transport_lock); 820 spin_unlock(&xprt->transport_lock);
822 return; 821 return;
@@ -853,19 +852,20 @@ static inline void xs_tcp_read_request(struct rpc_xprt *xprt, struct xdr_skb_rea
853 * be discarded. 852 * be discarded.
854 */ 853 */
855 transport->tcp_flags &= ~TCP_RCV_COPY_DATA; 854 transport->tcp_flags &= ~TCP_RCV_COPY_DATA;
856 dprintk("RPC: XID %08x truncated request\n", 855 dprintk("RPC: XID %08x truncated request\n",
857 ntohl(transport->tcp_xid)); 856 ntohl(transport->tcp_xid));
858 dprintk("RPC: xprt = %p, tcp_copied = %lu, tcp_offset = %u, tcp_reclen = %u\n", 857 dprintk("RPC: xprt = %p, tcp_copied = %lu, "
859 xprt, transport->tcp_copied, transport->tcp_offset, 858 "tcp_offset = %u, tcp_reclen = %u\n",
860 transport->tcp_reclen); 859 xprt, transport->tcp_copied,
860 transport->tcp_offset, transport->tcp_reclen);
861 goto out; 861 goto out;
862 } 862 }
863 863
864 dprintk("RPC: XID %08x read %Zd bytes\n", 864 dprintk("RPC: XID %08x read %Zd bytes\n",
865 ntohl(transport->tcp_xid), r); 865 ntohl(transport->tcp_xid), r);
866 dprintk("RPC: xprt = %p, tcp_copied = %lu, tcp_offset = %u, tcp_reclen = %u\n", 866 dprintk("RPC: xprt = %p, tcp_copied = %lu, tcp_offset = %u, "
867 xprt, transport->tcp_copied, transport->tcp_offset, 867 "tcp_reclen = %u\n", xprt, transport->tcp_copied,
868 transport->tcp_reclen); 868 transport->tcp_offset, transport->tcp_reclen);
869 869
870 if (transport->tcp_copied == req->rq_private_buf.buflen) 870 if (transport->tcp_copied == req->rq_private_buf.buflen)
871 transport->tcp_flags &= ~TCP_RCV_COPY_DATA; 871 transport->tcp_flags &= ~TCP_RCV_COPY_DATA;
@@ -891,7 +891,7 @@ static inline void xs_tcp_read_discard(struct sock_xprt *transport, struct xdr_s
891 desc->count -= len; 891 desc->count -= len;
892 desc->offset += len; 892 desc->offset += len;
893 transport->tcp_offset += len; 893 transport->tcp_offset += len;
894 dprintk("RPC: discarded %Zu bytes\n", len); 894 dprintk("RPC: discarded %Zu bytes\n", len);
895 xs_tcp_check_fraghdr(transport); 895 xs_tcp_check_fraghdr(transport);
896} 896}
897 897
@@ -905,7 +905,7 @@ static int xs_tcp_data_recv(read_descriptor_t *rd_desc, struct sk_buff *skb, uns
905 .count = len, 905 .count = len,
906 }; 906 };
907 907
908 dprintk("RPC: xs_tcp_data_recv started\n"); 908 dprintk("RPC: xs_tcp_data_recv started\n");
909 do { 909 do {
910 /* Read in a new fragment marker if necessary */ 910 /* Read in a new fragment marker if necessary */
911 /* Can we ever really expect to get completely empty fragments? */ 911 /* Can we ever really expect to get completely empty fragments? */
@@ -926,7 +926,7 @@ static int xs_tcp_data_recv(read_descriptor_t *rd_desc, struct sk_buff *skb, uns
926 /* Skip over any trailing bytes on short reads */ 926 /* Skip over any trailing bytes on short reads */
927 xs_tcp_read_discard(transport, &desc); 927 xs_tcp_read_discard(transport, &desc);
928 } while (desc.count); 928 } while (desc.count);
929 dprintk("RPC: xs_tcp_data_recv done\n"); 929 dprintk("RPC: xs_tcp_data_recv done\n");
930 return len - desc.count; 930 return len - desc.count;
931} 931}
932 932
@@ -941,8 +941,9 @@ static void xs_tcp_data_ready(struct sock *sk, int bytes)
941 struct rpc_xprt *xprt; 941 struct rpc_xprt *xprt;
942 read_descriptor_t rd_desc; 942 read_descriptor_t rd_desc;
943 943
944 dprintk("RPC: xs_tcp_data_ready...\n");
945
944 read_lock(&sk->sk_callback_lock); 946 read_lock(&sk->sk_callback_lock);
945 dprintk("RPC: xs_tcp_data_ready...\n");
946 if (!(xprt = xprt_from_sock(sk))) 947 if (!(xprt = xprt_from_sock(sk)))
947 goto out; 948 goto out;
948 if (xprt->shutdown) 949 if (xprt->shutdown)
@@ -968,11 +969,11 @@ static void xs_tcp_state_change(struct sock *sk)
968 read_lock(&sk->sk_callback_lock); 969 read_lock(&sk->sk_callback_lock);
969 if (!(xprt = xprt_from_sock(sk))) 970 if (!(xprt = xprt_from_sock(sk)))
970 goto out; 971 goto out;
971 dprintk("RPC: xs_tcp_state_change client %p...\n", xprt); 972 dprintk("RPC: xs_tcp_state_change client %p...\n", xprt);
972 dprintk("RPC: state %x conn %d dead %d zapped %d\n", 973 dprintk("RPC: state %x conn %d dead %d zapped %d\n",
973 sk->sk_state, xprt_connected(xprt), 974 sk->sk_state, xprt_connected(xprt),
974 sock_flag(sk, SOCK_DEAD), 975 sock_flag(sk, SOCK_DEAD),
975 sock_flag(sk, SOCK_ZAPPED)); 976 sock_flag(sk, SOCK_ZAPPED));
976 977
977 switch (sk->sk_state) { 978 switch (sk->sk_state) {
978 case TCP_ESTABLISHED: 979 case TCP_ESTABLISHED:
@@ -1140,7 +1141,7 @@ static void xs_set_port(struct rpc_xprt *xprt, unsigned short port)
1140{ 1141{
1141 struct sockaddr_in *sap = (struct sockaddr_in *) &xprt->addr; 1142 struct sockaddr_in *sap = (struct sockaddr_in *) &xprt->addr;
1142 1143
1143 dprintk("RPC: setting port for xprt %p to %u\n", xprt, port); 1144 dprintk("RPC: setting port for xprt %p to %u\n", xprt, port);
1144 1145
1145 sap->sin_port = htons(port); 1146 sap->sin_port = htons(port);
1146} 1147}
@@ -1159,7 +1160,7 @@ static int xs_bindresvport(struct sock_xprt *transport, struct socket *sock)
1159 sizeof(myaddr)); 1160 sizeof(myaddr));
1160 if (err == 0) { 1161 if (err == 0) {
1161 transport->port = port; 1162 transport->port = port;
1162 dprintk("RPC: xs_bindresvport bound to port %u\n", 1163 dprintk("RPC: xs_bindresvport bound to port %u\n",
1163 port); 1164 port);
1164 return 0; 1165 return 0;
1165 } 1166 }
@@ -1169,7 +1170,7 @@ static int xs_bindresvport(struct sock_xprt *transport, struct socket *sock)
1169 port--; 1170 port--;
1170 } while (err == -EADDRINUSE && port != transport->port); 1171 } while (err == -EADDRINUSE && port != transport->port);
1171 1172
1172 dprintk("RPC: can't bind to reserved port (%d).\n", -err); 1173 dprintk("RPC: can't bind to reserved port (%d).\n", -err);
1173 return err; 1174 return err;
1174} 1175}
1175 1176
@@ -1223,7 +1224,7 @@ static void xs_udp_connect_worker(struct work_struct *work)
1223 xs_close(xprt); 1224 xs_close(xprt);
1224 1225
1225 if ((err = sock_create_kern(PF_INET, SOCK_DGRAM, IPPROTO_UDP, &sock)) < 0) { 1226 if ((err = sock_create_kern(PF_INET, SOCK_DGRAM, IPPROTO_UDP, &sock)) < 0) {
1226 dprintk("RPC: can't create UDP transport socket (%d).\n", -err); 1227 dprintk("RPC: can't create UDP transport socket (%d).\n", -err);
1227 goto out; 1228 goto out;
1228 } 1229 }
1229 xs_reclassify_socket(sock); 1230 xs_reclassify_socket(sock);
@@ -1233,7 +1234,7 @@ static void xs_udp_connect_worker(struct work_struct *work)
1233 goto out; 1234 goto out;
1234 } 1235 }
1235 1236
1236 dprintk("RPC: worker connecting xprt %p to address: %s\n", 1237 dprintk("RPC: worker connecting xprt %p to address: %s\n",
1237 xprt, xprt->address_strings[RPC_DISPLAY_ALL]); 1238 xprt, xprt->address_strings[RPC_DISPLAY_ALL]);
1238 1239
1239 if (!transport->inet) { 1240 if (!transport->inet) {
@@ -1275,7 +1276,7 @@ static void xs_tcp_reuse_connection(struct rpc_xprt *xprt)
1275 struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); 1276 struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);
1276 struct sockaddr any; 1277 struct sockaddr any;
1277 1278
1278 dprintk("RPC: disconnecting xprt %p to reuse port\n", xprt); 1279 dprintk("RPC: disconnecting xprt %p to reuse port\n", xprt);
1279 1280
1280 /* 1281 /*
1281 * Disconnect the transport socket by doing a connect operation 1282 * Disconnect the transport socket by doing a connect operation
@@ -1285,7 +1286,7 @@ static void xs_tcp_reuse_connection(struct rpc_xprt *xprt)
1285 any.sa_family = AF_UNSPEC; 1286 any.sa_family = AF_UNSPEC;
1286 result = kernel_connect(transport->sock, &any, sizeof(any), 0); 1287 result = kernel_connect(transport->sock, &any, sizeof(any), 0);
1287 if (result) 1288 if (result)
1288 dprintk("RPC: AF_UNSPEC connect return code %d\n", 1289 dprintk("RPC: AF_UNSPEC connect return code %d\n",
1289 result); 1290 result);
1290} 1291}
1291 1292
@@ -1309,7 +1310,8 @@ static void xs_tcp_connect_worker(struct work_struct *work)
1309 if (!sock) { 1310 if (!sock) {
1310 /* start from scratch */ 1311 /* start from scratch */
1311 if ((err = sock_create_kern(PF_INET, SOCK_STREAM, IPPROTO_TCP, &sock)) < 0) { 1312 if ((err = sock_create_kern(PF_INET, SOCK_STREAM, IPPROTO_TCP, &sock)) < 0) {
1312 dprintk("RPC: can't create TCP transport socket (%d).\n", -err); 1313 dprintk("RPC: can't create TCP transport "
1314 "socket (%d).\n", -err);
1313 goto out; 1315 goto out;
1314 } 1316 }
1315 xs_reclassify_socket(sock); 1317 xs_reclassify_socket(sock);
@@ -1322,7 +1324,7 @@ static void xs_tcp_connect_worker(struct work_struct *work)
1322 /* "close" the socket, preserving the local port */ 1324 /* "close" the socket, preserving the local port */
1323 xs_tcp_reuse_connection(xprt); 1325 xs_tcp_reuse_connection(xprt);
1324 1326
1325 dprintk("RPC: worker connecting xprt %p to address: %s\n", 1327 dprintk("RPC: worker connecting xprt %p to address: %s\n",
1326 xprt, xprt->address_strings[RPC_DISPLAY_ALL]); 1328 xprt, xprt->address_strings[RPC_DISPLAY_ALL]);
1327 1329
1328 if (!transport->inet) { 1330 if (!transport->inet) {
@@ -1359,8 +1361,9 @@ static void xs_tcp_connect_worker(struct work_struct *work)
1359 xprt->stat.connect_start = jiffies; 1361 xprt->stat.connect_start = jiffies;
1360 status = kernel_connect(sock, (struct sockaddr *) &xprt->addr, 1362 status = kernel_connect(sock, (struct sockaddr *) &xprt->addr,
1361 xprt->addrlen, O_NONBLOCK); 1363 xprt->addrlen, O_NONBLOCK);
1362 dprintk("RPC: %p connect status %d connected %d sock state %d\n", 1364 dprintk("RPC: %p connect status %d connected %d sock state %d\n",
1363 xprt, -status, xprt_connected(xprt), sock->sk->sk_state); 1365 xprt, -status, xprt_connected(xprt),
1366 sock->sk->sk_state);
1364 if (status < 0) { 1367 if (status < 0) {
1365 switch (status) { 1368 switch (status) {
1366 case -EINPROGRESS: 1369 case -EINPROGRESS:
@@ -1404,7 +1407,8 @@ static void xs_connect(struct rpc_task *task)
1404 return; 1407 return;
1405 1408
1406 if (transport->sock != NULL) { 1409 if (transport->sock != NULL) {
1407 dprintk("RPC: xs_connect delayed xprt %p for %lu seconds\n", 1410 dprintk("RPC: xs_connect delayed xprt %p for %lu "
1411 "seconds\n",
1408 xprt, xprt->reestablish_timeout / HZ); 1412 xprt, xprt->reestablish_timeout / HZ);
1409 schedule_delayed_work(&transport->connect_worker, 1413 schedule_delayed_work(&transport->connect_worker,
1410 xprt->reestablish_timeout); 1414 xprt->reestablish_timeout);
@@ -1412,7 +1416,7 @@ static void xs_connect(struct rpc_task *task)
1412 if (xprt->reestablish_timeout > XS_TCP_MAX_REEST_TO) 1416 if (xprt->reestablish_timeout > XS_TCP_MAX_REEST_TO)
1413 xprt->reestablish_timeout = XS_TCP_MAX_REEST_TO; 1417 xprt->reestablish_timeout = XS_TCP_MAX_REEST_TO;
1414 } else { 1418 } else {
1415 dprintk("RPC: xs_connect scheduled xprt %p\n", xprt); 1419 dprintk("RPC: xs_connect scheduled xprt %p\n", xprt);
1416 schedule_delayed_work(&transport->connect_worker, 0); 1420 schedule_delayed_work(&transport->connect_worker, 0);
1417 1421
1418 /* flush_scheduled_work can sleep... */ 1422 /* flush_scheduled_work can sleep... */
@@ -1507,13 +1511,14 @@ static struct rpc_xprt *xs_setup_xprt(struct sockaddr *addr, size_t addrlen, uns
1507 struct sock_xprt *new; 1511 struct sock_xprt *new;
1508 1512
1509 if (addrlen > sizeof(xprt->addr)) { 1513 if (addrlen > sizeof(xprt->addr)) {
1510 dprintk("RPC: xs_setup_xprt: address too large\n"); 1514 dprintk("RPC: xs_setup_xprt: address too large\n");
1511 return ERR_PTR(-EBADF); 1515 return ERR_PTR(-EBADF);
1512 } 1516 }
1513 1517
1514 new = kzalloc(sizeof(*new), GFP_KERNEL); 1518 new = kzalloc(sizeof(*new), GFP_KERNEL);
1515 if (new == NULL) { 1519 if (new == NULL) {
1516 dprintk("RPC: xs_setup_xprt: couldn't allocate rpc_xprt\n"); 1520 dprintk("RPC: xs_setup_xprt: couldn't allocate "
1521 "rpc_xprt\n");
1517 return ERR_PTR(-ENOMEM); 1522 return ERR_PTR(-ENOMEM);
1518 } 1523 }
1519 xprt = &new->xprt; 1524 xprt = &new->xprt;
@@ -1522,7 +1527,8 @@ static struct rpc_xprt *xs_setup_xprt(struct sockaddr *addr, size_t addrlen, uns
1522 xprt->slot = kcalloc(xprt->max_reqs, sizeof(struct rpc_rqst), GFP_KERNEL); 1527 xprt->slot = kcalloc(xprt->max_reqs, sizeof(struct rpc_rqst), GFP_KERNEL);
1523 if (xprt->slot == NULL) { 1528 if (xprt->slot == NULL) {
1524 kfree(xprt); 1529 kfree(xprt);
1525 dprintk("RPC: xs_setup_xprt: couldn't allocate slot table\n"); 1530 dprintk("RPC: xs_setup_xprt: couldn't allocate slot "
1531 "table\n");
1526 return ERR_PTR(-ENOMEM); 1532 return ERR_PTR(-ENOMEM);
1527 } 1533 }
1528 1534
@@ -1572,7 +1578,7 @@ struct rpc_xprt *xs_setup_udp(struct sockaddr *addr, size_t addrlen, struct rpc_
1572 xprt_set_timeout(&xprt->timeout, 5, 5 * HZ); 1578 xprt_set_timeout(&xprt->timeout, 5, 5 * HZ);
1573 1579
1574 xs_format_peer_addresses(xprt); 1580 xs_format_peer_addresses(xprt);
1575 dprintk("RPC: set up transport to address %s\n", 1581 dprintk("RPC: set up transport to address %s\n",
1576 xprt->address_strings[RPC_DISPLAY_ALL]); 1582 xprt->address_strings[RPC_DISPLAY_ALL]);
1577 1583
1578 return xprt; 1584 return xprt;
@@ -1616,7 +1622,7 @@ struct rpc_xprt *xs_setup_tcp(struct sockaddr *addr, size_t addrlen, struct rpc_
1616 xprt_set_timeout(&xprt->timeout, 2, 60 * HZ); 1622 xprt_set_timeout(&xprt->timeout, 2, 60 * HZ);
1617 1623
1618 xs_format_peer_addresses(xprt); 1624 xs_format_peer_addresses(xprt);
1619 dprintk("RPC: set up transport to address %s\n", 1625 dprintk("RPC: set up transport to address %s\n",
1620 xprt->address_strings[RPC_DISPLAY_ALL]); 1626 xprt->address_strings[RPC_DISPLAY_ALL]);
1621 1627
1622 return xprt; 1628 return xprt;
@@ -1629,13 +1635,8 @@ struct rpc_xprt *xs_setup_tcp(struct sockaddr *addr, size_t addrlen, struct rpc_
1629int init_socket_xprt(void) 1635int init_socket_xprt(void)
1630{ 1636{
1631#ifdef RPC_DEBUG 1637#ifdef RPC_DEBUG
1632 if (!sunrpc_table_header) { 1638 if (!sunrpc_table_header)
1633 sunrpc_table_header = register_sysctl_table(sunrpc_table, 1); 1639 sunrpc_table_header = register_sysctl_table(sunrpc_table);
1634#ifdef CONFIG_PROC_FS
1635 if (sunrpc_table[0].de)
1636 sunrpc_table[0].de->owner = THIS_MODULE;
1637#endif
1638 }
1639#endif 1640#endif
1640 1641
1641 return 0; 1642 return 0;
diff --git a/net/unix/garbage.c b/net/unix/garbage.c
index f8bcf5d114d9..f20b7ea7c555 100644
--- a/net/unix/garbage.c
+++ b/net/unix/garbage.c
@@ -65,7 +65,6 @@
65 */ 65 */
66 66
67#include <linux/kernel.h> 67#include <linux/kernel.h>
68#include <linux/sched.h>
69#include <linux/string.h> 68#include <linux/string.h>
70#include <linux/socket.h> 69#include <linux/socket.h>
71#include <linux/un.h> 70#include <linux/un.h>
diff --git a/net/unix/sysctl_net_unix.c b/net/unix/sysctl_net_unix.c
index 690ffa5d5bfb..eb0bd57ebada 100644
--- a/net/unix/sysctl_net_unix.c
+++ b/net/unix/sysctl_net_unix.c
@@ -50,7 +50,7 @@ static struct ctl_table_header * unix_sysctl_header;
50 50
51void unix_sysctl_register(void) 51void unix_sysctl_register(void)
52{ 52{
53 unix_sysctl_header = register_sysctl_table(unix_root_table, 0); 53 unix_sysctl_header = register_sysctl_table(unix_root_table);
54} 54}
55 55
56void unix_sysctl_unregister(void) 56void unix_sysctl_unregister(void)
diff --git a/net/x25/sysctl_net_x25.c b/net/x25/sysctl_net_x25.c
index 5f631061c229..a59b77f18234 100644
--- a/net/x25/sysctl_net_x25.c
+++ b/net/x25/sysctl_net_x25.c
@@ -106,7 +106,7 @@ static struct ctl_table x25_root_table[] = {
106 106
107void __init x25_register_sysctl(void) 107void __init x25_register_sysctl(void)
108{ 108{
109 x25_table_header = register_sysctl_table(x25_root_table, 1); 109 x25_table_header = register_sysctl_table(x25_root_table);
110} 110}
111 111
112void x25_unregister_sysctl(void) 112void x25_unregister_sysctl(void)
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index c394b413f651..946b715db5ec 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -1550,7 +1550,7 @@ xfrm_state_ok(struct xfrm_tmpl *tmpl, struct xfrm_state *x,
1550 unsigned short family) 1550 unsigned short family)
1551{ 1551{
1552 if (xfrm_state_kern(x)) 1552 if (xfrm_state_kern(x))
1553 return tmpl->optional && !xfrm_state_addr_cmp(tmpl, x, family); 1553 return tmpl->optional && !xfrm_state_addr_cmp(tmpl, x, tmpl->encap_family);
1554 return x->id.proto == tmpl->id.proto && 1554 return x->id.proto == tmpl->id.proto &&
1555 (x->id.spi == tmpl->id.spi || !tmpl->id.spi) && 1555 (x->id.spi == tmpl->id.spi || !tmpl->id.spi) &&
1556 (x->props.reqid == tmpl->reqid || !tmpl->reqid) && 1556 (x->props.reqid == tmpl->reqid || !tmpl->reqid) &&