aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/802/fc.c1
-rw-r--r--net/802/fddi.c1
-rw-r--r--net/802/sysctl_net_802.c1
-rw-r--r--net/802/tr.c1
-rw-r--r--net/8021q/vlanproc.c1
-rw-r--r--net/appletalk/aarp.c1
-rw-r--r--net/appletalk/atalk_proc.c1
-rw-r--r--net/appletalk/ddp.c1
-rw-r--r--net/appletalk/sysctl_net_atalk.c1
-rw-r--r--net/atm/Makefile2
-rw-r--r--net/atm/atm_sysfs.c176
-rw-r--r--net/atm/br2684.c1
-rw-r--r--net/atm/clip.c1
-rw-r--r--net/atm/common.c8
-rw-r--r--net/atm/common.h2
-rw-r--r--net/atm/ioctl.c1
-rw-r--r--net/atm/lec.c1
-rw-r--r--net/atm/lec.h1
-rw-r--r--net/atm/mpc.c1
-rw-r--r--net/atm/mpoa_proc.c1
-rw-r--r--net/atm/pppoatm.c1
-rw-r--r--net/atm/proc.c1
-rw-r--r--net/atm/pvc.c1
-rw-r--r--net/atm/resources.c23
-rw-r--r--net/atm/resources.h3
-rw-r--r--net/ax25/af_ax25.c1
-rw-r--r--net/ax25/ax25_dev.c1
-rw-r--r--net/ax25/ax25_iface.c1
-rw-r--r--net/ax25/ax25_ip.c1
-rw-r--r--net/ax25/ax25_out.c1
-rw-r--r--net/ax25/ax25_timer.c1
-rw-r--r--net/ax25/sysctl_net_ax25.c1
-rw-r--r--net/bluetooth/af_bluetooth.c1
-rw-r--r--net/bluetooth/bnep/core.c1
-rw-r--r--net/bluetooth/bnep/netdev.c1
-rw-r--r--net/bluetooth/bnep/sock.c1
-rw-r--r--net/bluetooth/cmtp/capi.c1
-rw-r--r--net/bluetooth/cmtp/core.c1
-rw-r--r--net/bluetooth/cmtp/sock.c1
-rw-r--r--net/bluetooth/hci_conn.c1
-rw-r--r--net/bluetooth/hci_core.c1
-rw-r--r--net/bluetooth/hci_event.c1
-rw-r--r--net/bluetooth/hci_sock.c1
-rw-r--r--net/bluetooth/hci_sysfs.c1
-rw-r--r--net/bluetooth/hidp/core.c1
-rw-r--r--net/bluetooth/hidp/sock.c1
-rw-r--r--net/bluetooth/l2cap.c1
-rw-r--r--net/bluetooth/lib.c1
-rw-r--r--net/bluetooth/rfcomm/core.c1
-rw-r--r--net/bluetooth/rfcomm/sock.c1
-rw-r--r--net/bluetooth/rfcomm/tty.c1
-rw-r--r--net/bluetooth/sco.c1
-rw-r--r--net/bridge/br.c1
-rw-r--r--net/bridge/br_device.c4
-rw-r--r--net/bridge/br_if.c3
-rw-r--r--net/bridge/netfilter/ebt_ulog.c1
-rw-r--r--net/core/dev.c40
-rw-r--r--net/core/link_watch.c1
-rw-r--r--net/core/neighbour.c1
-rw-r--r--net/core/net-sysfs.c1
-rw-r--r--net/core/rtnetlink.c3
-rw-r--r--net/core/skbuff.c8
-rw-r--r--net/core/sock.c12
-rw-r--r--net/core/sysctl_net_core.c1
-rw-r--r--net/dccp/ackvec.h1
-rw-r--r--net/dccp/ccids/ccid2.c1
-rw-r--r--net/dccp/ccids/ccid3.c1
-rw-r--r--net/dccp/ccids/ccid3.h1
-rw-r--r--net/dccp/ccids/lib/loss_interval.c1
-rw-r--r--net/dccp/ccids/lib/loss_interval.h1
-rw-r--r--net/dccp/ccids/lib/packet_history.c1
-rw-r--r--net/dccp/ccids/lib/packet_history.h1
-rw-r--r--net/dccp/ccids/lib/tfrc_equation.c1
-rw-r--r--net/dccp/dccp.h1
-rw-r--r--net/dccp/diag.c1
-rw-r--r--net/dccp/feat.c1
-rw-r--r--net/dccp/input.c1
-rw-r--r--net/dccp/ipv4.c1
-rw-r--r--net/dccp/ipv6.c1
-rw-r--r--net/dccp/ipv6.h1
-rw-r--r--net/dccp/minisocks.c1
-rw-r--r--net/dccp/options.c1
-rw-r--r--net/dccp/output.c1
-rw-r--r--net/dccp/proto.c1
-rw-r--r--net/dccp/sysctl.c1
-rw-r--r--net/dccp/timer.c1
-rw-r--r--net/decnet/af_decnet.c1
-rw-r--r--net/decnet/dn_dev.c1
-rw-r--r--net/decnet/dn_fib.c1
-rw-r--r--net/decnet/dn_neigh.c1
-rw-r--r--net/decnet/dn_nsp_in.c1
-rw-r--r--net/decnet/dn_route.c1
-rw-r--r--net/decnet/dn_rules.c1
-rw-r--r--net/decnet/dn_table.c1
-rw-r--r--net/decnet/netfilter/dn_rtmsg.c2
-rw-r--r--net/decnet/sysctl_net_decnet.c1
-rw-r--r--net/econet/af_econet.c1
-rw-r--r--net/ethernet/eth.c1
-rw-r--r--net/ieee80211/ieee80211_crypt_ccmp.c1
-rw-r--r--net/ieee80211/ieee80211_crypt_tkip.c1
-rw-r--r--net/ieee80211/ieee80211_crypt_wep.c1
-rw-r--r--net/ieee80211/ieee80211_geo.c1
-rw-r--r--net/ieee80211/ieee80211_module.c1
-rw-r--r--net/ieee80211/ieee80211_rx.c1
-rw-r--r--net/ieee80211/ieee80211_tx.c1
-rw-r--r--net/ipv4/af_inet.c6
-rw-r--r--net/ipv4/ah4.c1
-rw-r--r--net/ipv4/arp.c1
-rw-r--r--net/ipv4/datagram.c1
-rw-r--r--net/ipv4/devinet.c1
-rw-r--r--net/ipv4/esp4.c1
-rw-r--r--net/ipv4/fib_frontend.c1
-rw-r--r--net/ipv4/fib_hash.c1
-rw-r--r--net/ipv4/fib_rules.c1
-rw-r--r--net/ipv4/fib_semantics.c1
-rw-r--r--net/ipv4/fib_trie.c1
-rw-r--r--net/ipv4/icmp.c1
-rw-r--r--net/ipv4/igmp.c1
-rw-r--r--net/ipv4/inet_connection_sock.c1
-rw-r--r--net/ipv4/inet_diag.c1
-rw-r--r--net/ipv4/inet_hashtables.c1
-rw-r--r--net/ipv4/inet_timewait_sock.c1
-rw-r--r--net/ipv4/ip_forward.c1
-rw-r--r--net/ipv4/ip_fragment.c1
-rw-r--r--net/ipv4/ip_gre.c1
-rw-r--r--net/ipv4/ip_input.c1
-rw-r--r--net/ipv4/ip_output.c5
-rw-r--r--net/ipv4/ip_sockglue.c1
-rw-r--r--net/ipv4/ipcomp.c1
-rw-r--r--net/ipv4/ipip.c1
-rw-r--r--net/ipv4/ipmr.c1
-rw-r--r--net/ipv4/ipvs/ip_vs_est.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/Kconfig2
-rw-r--r--net/ipv4/netfilter/arp_tables.c4
-rw-r--r--net/ipv4/netfilter/ip_conntrack_core.c1
-rw-r--r--net/ipv4/netfilter/ip_conntrack_ftp.c1
-rw-r--r--net/ipv4/netfilter/ip_conntrack_helper_h323.c1
-rw-r--r--net/ipv4/netfilter/ip_conntrack_helper_pptp.c1
-rw-r--r--net/ipv4/netfilter/ip_conntrack_irc.c1
-rw-r--r--net/ipv4/netfilter/ip_conntrack_proto_gre.c1
-rw-r--r--net/ipv4/netfilter/ip_conntrack_proto_sctp.c2
-rw-r--r--net/ipv4/netfilter/ip_conntrack_proto_tcp.c1
-rw-r--r--net/ipv4/netfilter/ip_conntrack_standalone.c1
-rw-r--r--net/ipv4/netfilter/ip_nat_helper.c1
-rw-r--r--net/ipv4/netfilter/ip_nat_helper_pptp.c1
-rw-r--r--net/ipv4/netfilter/ip_nat_proto_gre.c1
-rw-r--r--net/ipv4/netfilter/ip_nat_snmp_basic.c1
-rw-r--r--net/ipv4/netfilter/ip_nat_standalone.c1
-rw-r--r--net/ipv4/netfilter/ip_queue.c14
-rw-r--r--net/ipv4/netfilter/ip_tables.c4
-rw-r--r--net/ipv4/netfilter/ipt_CLUSTERIP.c1
-rw-r--r--net/ipv4/netfilter/ipt_MASQUERADE.c1
-rw-r--r--net/ipv4/netfilter/ipt_NETMAP.c1
-rw-r--r--net/ipv4/netfilter/ipt_REJECT.c1
-rw-r--r--net/ipv4/netfilter/ipt_ULOG.c1
-rw-r--r--net/ipv4/netfilter/iptable_mangle.c1
-rw-r--r--net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c1
-rw-r--r--net/ipv4/protocol.c1
-rw-r--r--net/ipv4/route.c1
-rw-r--r--net/ipv4/sysctl_net_ipv4.c1
-rw-r--r--net/ipv4/tcp.c18
-rw-r--r--net/ipv4/tcp_bic.c1
-rw-r--r--net/ipv4/tcp_cong.c1
-rw-r--r--net/ipv4/tcp_cubic.c1
-rw-r--r--net/ipv4/tcp_diag.c6
-rw-r--r--net/ipv4/tcp_highspeed.c1
-rw-r--r--net/ipv4/tcp_htcp.c1
-rw-r--r--net/ipv4/tcp_hybla.c1
-rw-r--r--net/ipv4/tcp_input.c5
-rw-r--r--net/ipv4/tcp_ipv4.c6
-rw-r--r--net/ipv4/tcp_minisocks.c3
-rw-r--r--net/ipv4/tcp_output.c11
-rw-r--r--net/ipv4/tcp_scalable.c1
-rw-r--r--net/ipv4/tcp_vegas.c1
-rw-r--r--net/ipv4/tcp_westwood.c1
-rw-r--r--net/ipv4/udp.c1
-rw-r--r--net/ipv4/xfrm4_policy.c1
-rw-r--r--net/ipv6/addrconf.c1
-rw-r--r--net/ipv6/af_inet6.c3
-rw-r--r--net/ipv6/ah6.c1
-rw-r--r--net/ipv6/anycast.c1
-rw-r--r--net/ipv6/esp6.c1
-rw-r--r--net/ipv6/exthdrs.c4
-rw-r--r--net/ipv6/inet6_connection_sock.c3
-rw-r--r--net/ipv6/inet6_hashtables.c1
-rw-r--r--net/ipv6/ip6_fib.c1
-rw-r--r--net/ipv6/ip6_flowlabel.c1
-rw-r--r--net/ipv6/ip6_input.c7
-rw-r--r--net/ipv6/ip6_output.c5
-rw-r--r--net/ipv6/ip6_tunnel.c1
-rw-r--r--net/ipv6/ipcomp6.c1
-rw-r--r--net/ipv6/ipv6_sockglue.c63
-rw-r--r--net/ipv6/ipv6_syms.c1
-rw-r--r--net/ipv6/mcast.c1
-rw-r--r--net/ipv6/ndisc.c1
-rw-r--r--net/ipv6/netfilter/ip6_queue.c2
-rw-r--r--net/ipv6/netfilter/ip6_tables.c4
-rw-r--r--net/ipv6/netfilter/ip6t_REJECT.c1
-rw-r--r--net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c1
-rw-r--r--net/ipv6/netfilter/nf_conntrack_reasm.c1
-rw-r--r--net/ipv6/proc.c1
-rw-r--r--net/ipv6/reassembly.c1
-rw-r--r--net/ipv6/route.c1
-rw-r--r--net/ipv6/sit.c1
-rw-r--r--net/ipv6/sysctl_net_ipv6.c1
-rw-r--r--net/ipv6/tcp_ipv6.c11
-rw-r--r--net/ipv6/udp.c1
-rw-r--r--net/ipv6/xfrm6_policy.c1
-rw-r--r--net/ipv6/xfrm6_tunnel.c1
-rw-r--r--net/ipx/af_ipx.c1
-rw-r--r--net/ipx/ipx_proc.c1
-rw-r--r--net/ipx/ipx_route.c1
-rw-r--r--net/ipx/sysctl_net_ipx.c1
-rw-r--r--net/irda/af_irda.c1
-rw-r--r--net/irda/ircomm/ircomm_core.c1
-rw-r--r--net/irda/ircomm/ircomm_tty.c1
-rw-r--r--net/irda/irda_device.c1
-rw-r--r--net/irda/iriap.c1
-rw-r--r--net/irda/irlan/irlan_client.c3
-rw-r--r--net/irda/irlan/irlan_common.c1
-rw-r--r--net/irda/irlan/irlan_eth.c1
-rw-r--r--net/irda/irlap.c1
-rw-r--r--net/irda/irlap_event.c1
-rw-r--r--net/irda/irlmp.c1
-rw-r--r--net/irda/irlmp_event.c1
-rw-r--r--net/irda/irlmp_frame.c1
-rw-r--r--net/irda/irmod.c1
-rw-r--r--net/irda/irnet/irnet.h1
-rw-r--r--net/irda/irsysctl.c1
-rw-r--r--net/irda/irttp.c1
-rw-r--r--net/irda/qos.c1
-rw-r--r--net/irda/timer.c1
-rw-r--r--net/key/af_key.c1
-rw-r--r--net/llc/af_llc.c1
-rw-r--r--net/llc/llc_if.c1
-rw-r--r--net/llc/llc_proc.c1
-rw-r--r--net/llc/llc_station.c1
-rw-r--r--net/llc/sysctl_net_llc.c1
-rw-r--r--net/netfilter/Kconfig5
-rw-r--r--net/netfilter/core.c1
-rw-r--r--net/netfilter/nf_conntrack_core.c1
-rw-r--r--net/netfilter/nf_conntrack_ftp.c1
-rw-r--r--net/netfilter/nf_conntrack_l3proto_generic.c1
-rw-r--r--net/netfilter/nf_conntrack_netlink.c1
-rw-r--r--net/netfilter/nf_conntrack_proto_sctp.c4
-rw-r--r--net/netfilter/nf_conntrack_proto_tcp.c1
-rw-r--r--net/netfilter/nf_conntrack_standalone.c1
-rw-r--r--net/netfilter/nf_internals.h1
-rw-r--r--net/netfilter/nf_log.c1
-rw-r--r--net/netfilter/nf_queue.c1
-rw-r--r--net/netfilter/nf_sockopt.c1
-rw-r--r--net/netfilter/nfnetlink.c3
-rw-r--r--net/netfilter/nfnetlink_queue.c12
-rw-r--r--net/netfilter/x_tables.c1
-rw-r--r--net/netfilter/xt_policy.c1
-rw-r--r--net/netfilter/xt_sctp.c2
-rw-r--r--net/netfilter/xt_tcpudp.c2
-rw-r--r--net/netlink/af_netlink.c1
-rw-r--r--net/netlink/attr.c1
-rw-r--r--net/netlink/genetlink.c3
-rw-r--r--net/netrom/af_netrom.c1
-rw-r--r--net/netrom/nr_dev.c1
-rw-r--r--net/packet/af_packet.c1
-rw-r--r--net/rose/af_rose.c1
-rw-r--r--net/rose/rose_dev.c1
-rw-r--r--net/rxrpc/rxrpc_syms.c1
-rw-r--r--net/rxrpc/sysctl.c1
-rw-r--r--net/sched/Kconfig8
-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/act_simple.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.h1
-rw-r--r--net/sched/cls_tcindex.c1
-rw-r--r--net/sched/cls_u32.c1
-rw-r--r--net/sched/em_cmp.c1
-rw-r--r--net/sched/em_meta.c1
-rw-r--r--net/sched/em_nbyte.c1
-rw-r--r--net/sched/em_text.c1
-rw-r--r--net/sched/em_u32.c1
-rw-r--r--net/sched/ematch.c1
-rw-r--r--net/sched/sch_api.c1
-rw-r--r--net/sched/sch_atm.c1
-rw-r--r--net/sched/sch_blackhole.c1
-rw-r--r--net/sched/sch_cbq.c1
-rw-r--r--net/sched/sch_dsmark.c1
-rw-r--r--net/sched/sch_fifo.c1
-rw-r--r--net/sched/sch_generic.c1
-rw-r--r--net/sched/sch_gred.c1
-rw-r--r--net/sched/sch_hfsc.c1
-rw-r--r--net/sched/sch_htb.c1
-rw-r--r--net/sched/sch_ingress.c1
-rw-r--r--net/sched/sch_netem.c1
-rw-r--r--net/sched/sch_prio.c1
-rw-r--r--net/sched/sch_red.c1
-rw-r--r--net/sched/sch_sfq.c1
-rw-r--r--net/sched/sch_tbf.c1
-rw-r--r--net/sctp/socket.c1
-rw-r--r--net/socket.c1
-rw-r--r--net/sunrpc/auth_gss/gss_mech_switch.c6
-rw-r--r--net/sunrpc/auth_gss/svcauth_gss.c271
-rw-r--r--net/sunrpc/pmap_clnt.c1
-rw-r--r--net/sunrpc/rpc_pipe.c1
-rw-r--r--net/sunrpc/sunrpc_syms.c1
-rw-r--r--net/sunrpc/svc.c3
-rw-r--r--net/sunrpc/sysctl.c1
-rw-r--r--net/sysctl_net.c1
-rw-r--r--net/tipc/core.c3
-rw-r--r--net/tipc/link.c11
-rw-r--r--net/tipc/node.c26
-rw-r--r--net/tipc/zone.h4
-rw-r--r--net/unix/af_unix.c28
-rw-r--r--net/wanrouter/af_wanpipe.c1
-rw-r--r--net/wanrouter/wanmain.c1
-rw-r--r--net/wanrouter/wanproc.c1
-rw-r--r--net/x25/af_x25.c1
-rw-r--r--net/x25/x25_dev.c1
-rw-r--r--net/x25/x25_proc.c1
-rw-r--r--net/x25/x25_route.c1
-rw-r--r--net/xfrm/xfrm_algo.c1
-rw-r--r--net/xfrm/xfrm_policy.c1
-rw-r--r--net/xfrm/xfrm_state.c2
-rw-r--r--net/xfrm/xfrm_user.c2
334 files changed, 674 insertions, 478 deletions
diff --git a/net/802/fc.c b/net/802/fc.c
index 282c4ab1abe6..2a27e37bc4cb 100644
--- a/net/802/fc.c
+++ b/net/802/fc.c
@@ -10,7 +10,6 @@
10 * v 1.0 03/22/99 10 * v 1.0 03/22/99
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <asm/uaccess.h> 13#include <asm/uaccess.h>
15#include <asm/system.h> 14#include <asm/system.h>
16#include <linux/types.h> 15#include <linux/types.h>
diff --git a/net/802/fddi.c b/net/802/fddi.c
index ac242a4bc346..797c6d961deb 100644
--- a/net/802/fddi.c
+++ b/net/802/fddi.c
@@ -26,7 +26,6 @@
26 * Maciej W. Rozycki : IPv6 support 26 * Maciej W. Rozycki : IPv6 support
27 */ 27 */
28 28
29#include <linux/config.h>
30#include <linux/module.h> 29#include <linux/module.h>
31#include <asm/system.h> 30#include <asm/system.h>
32#include <linux/types.h> 31#include <linux/types.h>
diff --git a/net/802/sysctl_net_802.c b/net/802/sysctl_net_802.c
index 700129556c13..ead56037398b 100644
--- a/net/802/sysctl_net_802.c
+++ b/net/802/sysctl_net_802.c
@@ -10,7 +10,6 @@
10 * 2 of the License, or (at your option) any later version. 10 * 2 of the License, or (at your option) any later version.
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/mm.h> 13#include <linux/mm.h>
15#include <linux/if_tr.h> 14#include <linux/if_tr.h>
16#include <linux/sysctl.h> 15#include <linux/sysctl.h>
diff --git a/net/802/tr.c b/net/802/tr.c
index e9dc803f2fe0..d7d8f40c4fed 100644
--- a/net/802/tr.c
+++ b/net/802/tr.c
@@ -17,7 +17,6 @@
17 17
18#include <asm/uaccess.h> 18#include <asm/uaccess.h>
19#include <asm/system.h> 19#include <asm/system.h>
20#include <linux/config.h>
21#include <linux/module.h> 20#include <linux/module.h>
22#include <linux/types.h> 21#include <linux/types.h>
23#include <linux/kernel.h> 22#include <linux/kernel.h>
diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c
index 7b214cffc956..a8fc0de1f969 100644
--- a/net/8021q/vlanproc.c
+++ b/net/8021q/vlanproc.c
@@ -17,7 +17,6 @@
17 * Jan 20, 1998 Ben Greear Initial Version 17 * Jan 20, 1998 Ben Greear Initial Version
18 *****************************************************************************/ 18 *****************************************************************************/
19 19
20#include <linux/config.h>
21#include <linux/module.h> 20#include <linux/module.h>
22#include <linux/stddef.h> /* offsetof(), etc. */ 21#include <linux/stddef.h> /* offsetof(), etc. */
23#include <linux/errno.h> /* return codes */ 22#include <linux/errno.h> /* return codes */
diff --git a/net/appletalk/aarp.c b/net/appletalk/aarp.c
index 7076097debc2..f3777ec5bcb9 100644
--- a/net/appletalk/aarp.c
+++ b/net/appletalk/aarp.c
@@ -29,7 +29,6 @@
29 * 29 *
30 */ 30 */
31 31
32#include <linux/config.h>
33#include <linux/if_arp.h> 32#include <linux/if_arp.h>
34#include <net/sock.h> 33#include <net/sock.h>
35#include <net/datalink.h> 34#include <net/datalink.h>
diff --git a/net/appletalk/atalk_proc.c b/net/appletalk/atalk_proc.c
index dc4048dd98c1..7ae4916cd26d 100644
--- a/net/appletalk/atalk_proc.c
+++ b/net/appletalk/atalk_proc.c
@@ -8,7 +8,6 @@
8 * Free Software Foundation, version 2. 8 * Free Software Foundation, version 2.
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/init.h> 11#include <linux/init.h>
13#include <linux/proc_fs.h> 12#include <linux/proc_fs.h>
14#include <linux/seq_file.h> 13#include <linux/seq_file.h>
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index 7b1eb9a4fc96..5ee96d4b40e9 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -51,7 +51,6 @@
51 * 51 *
52 */ 52 */
53 53
54#include <linux/config.h>
55#include <linux/capability.h> 54#include <linux/capability.h>
56#include <linux/module.h> 55#include <linux/module.h>
57#include <linux/if_arp.h> 56#include <linux/if_arp.h>
diff --git a/net/appletalk/sysctl_net_atalk.c b/net/appletalk/sysctl_net_atalk.c
index af7f0604395d..40b0af7437a2 100644
--- a/net/appletalk/sysctl_net_atalk.c
+++ b/net/appletalk/sysctl_net_atalk.c
@@ -6,7 +6,6 @@
6 * Dynamic registration, added aarp entries. (5/30/97 Chris Horn) 6 * Dynamic registration, added aarp entries. (5/30/97 Chris Horn)
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/sysctl.h> 9#include <linux/sysctl.h>
11#include <net/sock.h> 10#include <net/sock.h>
12#include <linux/atalk.h> 11#include <linux/atalk.h>
diff --git a/net/atm/Makefile b/net/atm/Makefile
index d5818751f6ba..89656d6c0b90 100644
--- a/net/atm/Makefile
+++ b/net/atm/Makefile
@@ -2,7 +2,7 @@
2# Makefile for the ATM Protocol Families. 2# Makefile for the ATM Protocol Families.
3# 3#
4 4
5atm-y := addr.o pvc.o signaling.o svc.o ioctl.o common.o atm_misc.o raw.o resources.o 5atm-y := addr.o pvc.o signaling.o svc.o ioctl.o common.o atm_misc.o raw.o resources.o atm_sysfs.o
6mpoa-objs := mpc.o mpoa_caches.o mpoa_proc.o 6mpoa-objs := mpc.o mpoa_caches.o mpoa_proc.o
7 7
8obj-$(CONFIG_ATM) += atm.o 8obj-$(CONFIG_ATM) += atm.o
diff --git a/net/atm/atm_sysfs.c b/net/atm/atm_sysfs.c
new file mode 100644
index 000000000000..5df4b9a068bb
--- /dev/null
+++ b/net/atm/atm_sysfs.c
@@ -0,0 +1,176 @@
1/* ATM driver model support. */
2
3#include <linux/config.h>
4#include <linux/kernel.h>
5#include <linux/init.h>
6#include <linux/kobject.h>
7#include <linux/atmdev.h>
8#include "common.h"
9#include "resources.h"
10
11#define to_atm_dev(cldev) container_of(cldev, struct atm_dev, class_dev)
12
13static ssize_t show_type(struct class_device *cdev, char *buf)
14{
15 struct atm_dev *adev = to_atm_dev(cdev);
16 return sprintf(buf, "%s\n", adev->type);
17}
18
19static ssize_t show_address(struct class_device *cdev, char *buf)
20{
21 char *pos = buf;
22 struct atm_dev *adev = to_atm_dev(cdev);
23 int i;
24
25 for (i = 0; i < (ESI_LEN - 1); i++)
26 pos += sprintf(pos, "%02x:", adev->esi[i]);
27 pos += sprintf(pos, "%02x\n", adev->esi[i]);
28
29 return pos - buf;
30}
31
32static ssize_t show_atmaddress(struct class_device *cdev, char *buf)
33{
34 unsigned long flags;
35 char *pos = buf;
36 struct atm_dev *adev = to_atm_dev(cdev);
37 struct atm_dev_addr *aaddr;
38 int bin[] = { 1, 2, 10, 6, 1 }, *fmt = bin;
39 int i, j;
40
41 spin_lock_irqsave(&adev->lock, flags);
42 list_for_each_entry(aaddr, &adev->local, entry) {
43 for(i = 0, j = 0; i < ATM_ESA_LEN; ++i, ++j) {
44 if (j == *fmt) {
45 pos += sprintf(pos, ".");
46 ++fmt;
47 j = 0;
48 }
49 pos += sprintf(pos, "%02x", aaddr->addr.sas_addr.prv[i]);
50 }
51 pos += sprintf(pos, "\n");
52 }
53 spin_unlock_irqrestore(&adev->lock, flags);
54
55 return pos - buf;
56}
57
58static ssize_t show_carrier(struct class_device *cdev, char *buf)
59{
60 char *pos = buf;
61 struct atm_dev *adev = to_atm_dev(cdev);
62
63 pos += sprintf(pos, "%d\n",
64 adev->signal == ATM_PHY_SIG_LOST ? 0 : 1);
65
66 return pos - buf;
67}
68
69static ssize_t show_link_rate(struct class_device *cdev, char *buf)
70{
71 char *pos = buf;
72 struct atm_dev *adev = to_atm_dev(cdev);
73 int link_rate;
74
75 /* show the link rate, not the data rate */
76 switch (adev->link_rate) {
77 case ATM_OC3_PCR:
78 link_rate = 155520000;
79 break;
80 case ATM_OC12_PCR:
81 link_rate = 622080000;
82 break;
83 case ATM_25_PCR:
84 link_rate = 25600000;
85 break;
86 default:
87 link_rate = adev->link_rate * 8 * 53;
88 }
89 pos += sprintf(pos, "%d\n", link_rate);
90
91 return pos - buf;
92}
93
94static CLASS_DEVICE_ATTR(address, S_IRUGO, show_address, NULL);
95static CLASS_DEVICE_ATTR(atmaddress, S_IRUGO, show_atmaddress, NULL);
96static CLASS_DEVICE_ATTR(carrier, S_IRUGO, show_carrier, NULL);
97static CLASS_DEVICE_ATTR(type, S_IRUGO, show_type, NULL);
98static CLASS_DEVICE_ATTR(link_rate, S_IRUGO, show_link_rate, NULL);
99
100static struct class_device_attribute *atm_attrs[] = {
101 &class_device_attr_atmaddress,
102 &class_device_attr_address,
103 &class_device_attr_carrier,
104 &class_device_attr_type,
105 &class_device_attr_link_rate,
106 NULL
107};
108
109static int atm_uevent(struct class_device *cdev, char **envp, int num_envp, char *buf, int size)
110{
111 struct atm_dev *adev;
112 int i = 0, len = 0;
113
114 if (!cdev)
115 return -ENODEV;
116
117 adev = to_atm_dev(cdev);
118 if (!adev)
119 return -ENODEV;
120
121 if (add_uevent_var(envp, num_envp, &i, buf, size, &len,
122 "NAME=%s%d", adev->type, adev->number))
123 return -ENOMEM;
124
125 envp[i] = NULL;
126 return 0;
127}
128
129static void atm_release(struct class_device *cdev)
130{
131 struct atm_dev *adev = to_atm_dev(cdev);
132
133 kfree(adev);
134}
135
136static struct class atm_class = {
137 .name = "atm",
138 .release = atm_release,
139 .uevent = atm_uevent,
140};
141
142int atm_register_sysfs(struct atm_dev *adev)
143{
144 struct class_device *cdev = &adev->class_dev;
145 int i, err;
146
147 cdev->class = &atm_class;
148 class_set_devdata(cdev, adev);
149
150 snprintf(cdev->class_id, BUS_ID_SIZE, "%s%d", adev->type, adev->number);
151 err = class_device_register(cdev);
152 if (err < 0)
153 return err;
154
155 for (i = 0; atm_attrs[i]; i++)
156 class_device_create_file(cdev, atm_attrs[i]);
157
158 return 0;
159}
160
161void atm_unregister_sysfs(struct atm_dev *adev)
162{
163 struct class_device *cdev = &adev->class_dev;
164
165 class_device_del(cdev);
166}
167
168int __init atm_sysfs_init(void)
169{
170 return class_register(&atm_class);
171}
172
173void __exit atm_sysfs_exit(void)
174{
175 class_unregister(&atm_class);
176}
diff --git a/net/atm/br2684.c b/net/atm/br2684.c
index 680ccb12aae8..a487233dc466 100644
--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -5,7 +5,6 @@ Author: Marcell GAL, 2000, XDSL Ltd, Hungary
5*/ 5*/
6 6
7#include <linux/module.h> 7#include <linux/module.h>
8#include <linux/config.h>
9#include <linux/init.h> 8#include <linux/init.h>
10#include <linux/kernel.h> 9#include <linux/kernel.h>
11#include <linux/list.h> 10#include <linux/list.h>
diff --git a/net/atm/clip.c b/net/atm/clip.c
index f92f9c94d2c7..87a454f5c89c 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -2,7 +2,6 @@
2 2
3/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ 3/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
4 4
5#include <linux/config.h>
6#include <linux/string.h> 5#include <linux/string.h>
7#include <linux/errno.h> 6#include <linux/errno.h>
8#include <linux/kernel.h> /* for UINT_MAX */ 7#include <linux/kernel.h> /* for UINT_MAX */
diff --git a/net/atm/common.c b/net/atm/common.c
index ae002220fa99..fbabff494468 100644
--- a/net/atm/common.c
+++ b/net/atm/common.c
@@ -3,7 +3,6 @@
3/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ 3/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
4 4
5 5
6#include <linux/config.h>
7#include <linux/module.h> 6#include <linux/module.h>
8#include <linux/kmod.h> 7#include <linux/kmod.h>
9#include <linux/net.h> /* struct socket, struct proto_ops */ 8#include <linux/net.h> /* struct socket, struct proto_ops */
@@ -791,8 +790,14 @@ static int __init atm_init(void)
791 printk(KERN_ERR "atm_proc_init() failed with %d\n",error); 790 printk(KERN_ERR "atm_proc_init() failed with %d\n",error);
792 goto out_atmsvc_exit; 791 goto out_atmsvc_exit;
793 } 792 }
793 if ((error = atm_sysfs_init()) < 0) {
794 printk(KERN_ERR "atm_sysfs_init() failed with %d\n",error);
795 goto out_atmproc_exit;
796 }
794out: 797out:
795 return error; 798 return error;
799out_atmproc_exit:
800 atm_proc_exit();
796out_atmsvc_exit: 801out_atmsvc_exit:
797 atmsvc_exit(); 802 atmsvc_exit();
798out_atmpvc_exit: 803out_atmpvc_exit:
@@ -805,6 +810,7 @@ out_unregister_vcc_proto:
805static void __exit atm_exit(void) 810static void __exit atm_exit(void)
806{ 811{
807 atm_proc_exit(); 812 atm_proc_exit();
813 atm_sysfs_exit();
808 atmsvc_exit(); 814 atmsvc_exit();
809 atmpvc_exit(); 815 atmpvc_exit();
810 proto_unregister(&vcc_proto); 816 proto_unregister(&vcc_proto);
diff --git a/net/atm/common.h b/net/atm/common.h
index 4887c317cefe..a422da7788fb 100644
--- a/net/atm/common.h
+++ b/net/atm/common.h
@@ -28,6 +28,8 @@ int atmpvc_init(void);
28void atmpvc_exit(void); 28void atmpvc_exit(void);
29int atmsvc_init(void); 29int atmsvc_init(void);
30void atmsvc_exit(void); 30void atmsvc_exit(void);
31int atm_sysfs_init(void);
32void atm_sysfs_exit(void);
31 33
32#ifdef CONFIG_PROC_FS 34#ifdef CONFIG_PROC_FS
33int atm_proc_init(void); 35int atm_proc_init(void);
diff --git a/net/atm/ioctl.c b/net/atm/ioctl.c
index 851cfa6312af..8c2022c3e81d 100644
--- a/net/atm/ioctl.c
+++ b/net/atm/ioctl.c
@@ -4,7 +4,6 @@
4/* 2003 John Levon <levon@movementarian.org> */ 4/* 2003 John Levon <levon@movementarian.org> */
5 5
6 6
7#include <linux/config.h>
8#include <linux/module.h> 7#include <linux/module.h>
9#include <linux/kmod.h> 8#include <linux/kmod.h>
10#include <linux/net.h> /* struct socket, struct proto_ops */ 9#include <linux/net.h> /* struct socket, struct proto_ops */
diff --git a/net/atm/lec.c b/net/atm/lec.c
index c4fc722fef9a..4b68a18171cf 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -4,7 +4,6 @@
4 * 4 *
5 */ 5 */
6 6
7#include <linux/config.h>
8#include <linux/kernel.h> 7#include <linux/kernel.h>
9#include <linux/bitops.h> 8#include <linux/bitops.h>
10#include <linux/capability.h> 9#include <linux/capability.h>
diff --git a/net/atm/lec.h b/net/atm/lec.h
index 6606082b29a8..c22a8bfa1f81 100644
--- a/net/atm/lec.h
+++ b/net/atm/lec.h
@@ -9,7 +9,6 @@
9#ifndef _LEC_H_ 9#ifndef _LEC_H_
10#define _LEC_H_ 10#define _LEC_H_
11 11
12#include <linux/config.h>
13#include <linux/atmdev.h> 12#include <linux/atmdev.h>
14#include <linux/netdevice.h> 13#include <linux/netdevice.h>
15#include <linux/atmlec.h> 14#include <linux/atmlec.h>
diff --git a/net/atm/mpc.c b/net/atm/mpc.c
index 5fe77df00186..9aafe1e2f048 100644
--- a/net/atm/mpc.c
+++ b/net/atm/mpc.c
@@ -25,7 +25,6 @@
25#include <linux/atmlec.h> 25#include <linux/atmlec.h>
26#include <linux/atmmpc.h> 26#include <linux/atmmpc.h>
27/* Modular too */ 27/* Modular too */
28#include <linux/config.h>
29#include <linux/module.h> 28#include <linux/module.h>
30 29
31#include "lec.h" 30#include "lec.h"
diff --git a/net/atm/mpoa_proc.c b/net/atm/mpoa_proc.c
index 60834b5a14d6..d37b8911b3ab 100644
--- a/net/atm/mpoa_proc.c
+++ b/net/atm/mpoa_proc.c
@@ -1,4 +1,3 @@
1#include <linux/config.h>
2 1
3#ifdef CONFIG_PROC_FS 2#ifdef CONFIG_PROC_FS
4#include <linux/errno.h> 3#include <linux/errno.h>
diff --git a/net/atm/pppoatm.c b/net/atm/pppoatm.c
index 1489067c1e84..76a7d8ff6c0e 100644
--- a/net/atm/pppoatm.c
+++ b/net/atm/pppoatm.c
@@ -34,7 +34,6 @@
34 */ 34 */
35 35
36#include <linux/module.h> 36#include <linux/module.h>
37#include <linux/config.h>
38#include <linux/init.h> 37#include <linux/init.h>
39#include <linux/skbuff.h> 38#include <linux/skbuff.h>
40#include <linux/atm.h> 39#include <linux/atm.h>
diff --git a/net/atm/proc.c b/net/atm/proc.c
index 4041054e5282..3f95b0886a6a 100644
--- a/net/atm/proc.c
+++ b/net/atm/proc.c
@@ -8,7 +8,6 @@
8 * the reader. 8 * the reader.
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/module.h> /* for EXPORT_SYMBOL */ 11#include <linux/module.h> /* for EXPORT_SYMBOL */
13#include <linux/string.h> 12#include <linux/string.h>
14#include <linux/types.h> 13#include <linux/types.h>
diff --git a/net/atm/pvc.c b/net/atm/pvc.c
index f2c541774dcd..b2148b43a426 100644
--- a/net/atm/pvc.c
+++ b/net/atm/pvc.c
@@ -3,7 +3,6 @@
3/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ 3/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
4 4
5 5
6#include <linux/config.h>
7#include <linux/net.h> /* struct socket, struct proto_ops */ 6#include <linux/net.h> /* struct socket, struct proto_ops */
8#include <linux/atm.h> /* ATM stuff */ 7#include <linux/atm.h> /* ATM stuff */
9#include <linux/atmdev.h> /* ATM devices */ 8#include <linux/atmdev.h> /* ATM devices */
diff --git a/net/atm/resources.c b/net/atm/resources.c
index 18ac80698f83..de25c6408b04 100644
--- a/net/atm/resources.c
+++ b/net/atm/resources.c
@@ -8,7 +8,6 @@
8 * use the default destruct function initialized by sock_init_data */ 8 * use the default destruct function initialized by sock_init_data */
9 9
10 10
11#include <linux/config.h>
12#include <linux/ctype.h> 11#include <linux/ctype.h>
13#include <linux/string.h> 12#include <linux/string.h>
14#include <linux/atmdev.h> 13#include <linux/atmdev.h>
@@ -114,14 +113,27 @@ struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops,
114 printk(KERN_ERR "atm_dev_register: " 113 printk(KERN_ERR "atm_dev_register: "
115 "atm_proc_dev_register failed for dev %s\n", 114 "atm_proc_dev_register failed for dev %s\n",
116 type); 115 type);
117 mutex_unlock(&atm_dev_mutex); 116 goto out_fail;
118 kfree(dev); 117 }
119 return NULL; 118
119 if (atm_register_sysfs(dev) < 0) {
120 printk(KERN_ERR "atm_dev_register: "
121 "atm_register_sysfs failed for dev %s\n",
122 type);
123 atm_proc_dev_deregister(dev);
124 goto out_fail;
120 } 125 }
126
121 list_add_tail(&dev->dev_list, &atm_devs); 127 list_add_tail(&dev->dev_list, &atm_devs);
122 mutex_unlock(&atm_dev_mutex);
123 128
129out:
130 mutex_unlock(&atm_dev_mutex);
124 return dev; 131 return dev;
132
133out_fail:
134 kfree(dev);
135 dev = NULL;
136 goto out;
125} 137}
126 138
127 139
@@ -140,6 +152,7 @@ void atm_dev_deregister(struct atm_dev *dev)
140 mutex_unlock(&atm_dev_mutex); 152 mutex_unlock(&atm_dev_mutex);
141 153
142 atm_dev_release_vccs(dev); 154 atm_dev_release_vccs(dev);
155 atm_unregister_sysfs(dev);
143 atm_proc_dev_deregister(dev); 156 atm_proc_dev_deregister(dev);
144 157
145 atm_dev_put(dev); 158 atm_dev_put(dev);
diff --git a/net/atm/resources.h b/net/atm/resources.h
index ac7222fee7a8..1d004aaaeec1 100644
--- a/net/atm/resources.h
+++ b/net/atm/resources.h
@@ -6,7 +6,6 @@
6#ifndef NET_ATM_RESOURCES_H 6#ifndef NET_ATM_RESOURCES_H
7#define NET_ATM_RESOURCES_H 7#define NET_ATM_RESOURCES_H
8 8
9#include <linux/config.h>
10#include <linux/atmdev.h> 9#include <linux/atmdev.h>
11#include <linux/mutex.h> 10#include <linux/mutex.h>
12 11
@@ -43,4 +42,6 @@ static inline void atm_proc_dev_deregister(struct atm_dev *dev)
43 42
44#endif /* CONFIG_PROC_FS */ 43#endif /* CONFIG_PROC_FS */
45 44
45int atm_register_sysfs(struct atm_dev *adev);
46void atm_unregister_sysfs(struct atm_dev *adev);
46#endif 47#endif
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index a2e0dd047e9f..10a3c0aa8398 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -13,7 +13,6 @@
13 * Copyright (C) Hans Alblas PE1AYX (hans@esrac.ele.tue.nl) 13 * Copyright (C) Hans Alblas PE1AYX (hans@esrac.ele.tue.nl)
14 * Copyright (C) Frederic Rible F1OAT (frible@teaser.fr) 14 * Copyright (C) Frederic Rible F1OAT (frible@teaser.fr)
15 */ 15 */
16#include <linux/config.h>
17#include <linux/capability.h> 16#include <linux/capability.h>
18#include <linux/module.h> 17#include <linux/module.h>
19#include <linux/errno.h> 18#include <linux/errno.h>
diff --git a/net/ax25/ax25_dev.c b/net/ax25/ax25_dev.c
index dab77efe34a6..47e6e790bd67 100644
--- a/net/ax25/ax25_dev.c
+++ b/net/ax25/ax25_dev.c
@@ -6,7 +6,6 @@
6 * 6 *
7 * Copyright (C) Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk) 7 * Copyright (C) Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk)
8 */ 8 */
9#include <linux/config.h>
10#include <linux/errno.h> 9#include <linux/errno.h>
11#include <linux/types.h> 10#include <linux/types.h>
12#include <linux/socket.h> 11#include <linux/socket.h>
diff --git a/net/ax25/ax25_iface.c b/net/ax25/ax25_iface.c
index 3bb152710b77..77ba07c67682 100644
--- a/net/ax25/ax25_iface.c
+++ b/net/ax25/ax25_iface.c
@@ -6,7 +6,6 @@
6 * 6 *
7 * Copyright (C) Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk) 7 * Copyright (C) Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk)
8 */ 8 */
9#include <linux/config.h>
10#include <linux/errno.h> 9#include <linux/errno.h>
11#include <linux/types.h> 10#include <linux/types.h>
12#include <linux/socket.h> 11#include <linux/socket.h>
diff --git a/net/ax25/ax25_ip.c b/net/ax25/ax25_ip.c
index a0b534f80f17..9be5c15e63d3 100644
--- a/net/ax25/ax25_ip.c
+++ b/net/ax25/ax25_ip.c
@@ -6,7 +6,6 @@
6 * 6 *
7 * Copyright (C) Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk) 7 * Copyright (C) Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk)
8 */ 8 */
9#include <linux/config.h>
10#include <linux/errno.h> 9#include <linux/errno.h>
11#include <linux/types.h> 10#include <linux/types.h>
12#include <linux/socket.h> 11#include <linux/socket.h>
diff --git a/net/ax25/ax25_out.c b/net/ax25/ax25_out.c
index 5d99852b239c..d7736e585336 100644
--- a/net/ax25/ax25_out.c
+++ b/net/ax25/ax25_out.c
@@ -8,7 +8,6 @@
8 * Copyright (C) Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk) 8 * Copyright (C) Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk)
9 * Copyright (C) Joerg Reuter DL1BKE (jreuter@yaina.de) 9 * Copyright (C) Joerg Reuter DL1BKE (jreuter@yaina.de)
10 */ 10 */
11#include <linux/config.h>
12#include <linux/errno.h> 11#include <linux/errno.h>
13#include <linux/types.h> 12#include <linux/types.h>
14#include <linux/socket.h> 13#include <linux/socket.h>
diff --git a/net/ax25/ax25_timer.c b/net/ax25/ax25_timer.c
index ec254057f212..72594867fab6 100644
--- a/net/ax25/ax25_timer.c
+++ b/net/ax25/ax25_timer.c
@@ -12,7 +12,6 @@
12 * Copyright (C) Frederic Rible F1OAT (frible@teaser.fr) 12 * Copyright (C) Frederic Rible F1OAT (frible@teaser.fr)
13 * Copyright (C) 2002 Ralf Baechle DO1GRB (ralf@gnu.org) 13 * Copyright (C) 2002 Ralf Baechle DO1GRB (ralf@gnu.org)
14 */ 14 */
15#include <linux/config.h>
16#include <linux/errno.h> 15#include <linux/errno.h>
17#include <linux/types.h> 16#include <linux/types.h>
18#include <linux/socket.h> 17#include <linux/socket.h>
diff --git a/net/ax25/sysctl_net_ax25.c b/net/ax25/sysctl_net_ax25.c
index bdb64c36df12..369a75b160f2 100644
--- a/net/ax25/sysctl_net_ax25.c
+++ b/net/ax25/sysctl_net_ax25.c
@@ -6,7 +6,6 @@
6 * 6 *
7 * Copyright (C) 1996 Mike Shaver (shaver@zeroknowledge.com) 7 * Copyright (C) 1996 Mike Shaver (shaver@zeroknowledge.com)
8 */ 8 */
9#include <linux/config.h>
10#include <linux/mm.h> 9#include <linux/mm.h>
11#include <linux/sysctl.h> 10#include <linux/sysctl.h>
12#include <linux/spinlock.h> 11#include <linux/spinlock.h>
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c
index 469eda0f0dfd..51f867062e1d 100644
--- a/net/bluetooth/af_bluetooth.c
+++ b/net/bluetooth/af_bluetooth.c
@@ -24,7 +24,6 @@
24 24
25/* Bluetooth address family and sockets. */ 25/* Bluetooth address family and sockets. */
26 26
27#include <linux/config.h>
28#include <linux/module.h> 27#include <linux/module.h>
29 28
30#include <linux/types.h> 29#include <linux/types.h>
diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c
index d908d49dc9f8..e620061fb50f 100644
--- a/net/bluetooth/bnep/core.c
+++ b/net/bluetooth/bnep/core.c
@@ -29,7 +29,6 @@
29 * $Id: core.c,v 1.20 2002/08/04 21:23:58 maxk Exp $ 29 * $Id: core.c,v 1.20 2002/08/04 21:23:58 maxk Exp $
30 */ 30 */
31 31
32#include <linux/config.h>
33#include <linux/module.h> 32#include <linux/module.h>
34 33
35#include <linux/kernel.h> 34#include <linux/kernel.h>
diff --git a/net/bluetooth/bnep/netdev.c b/net/bluetooth/bnep/netdev.c
index 921204f95f4a..7f7b27db6a8f 100644
--- a/net/bluetooth/bnep/netdev.c
+++ b/net/bluetooth/bnep/netdev.c
@@ -29,7 +29,6 @@
29 * $Id: netdev.c,v 1.8 2002/08/04 21:23:58 maxk Exp $ 29 * $Id: netdev.c,v 1.8 2002/08/04 21:23:58 maxk Exp $
30 */ 30 */
31 31
32#include <linux/config.h>
33#include <linux/module.h> 32#include <linux/module.h>
34 33
35#include <linux/socket.h> 34#include <linux/socket.h>
diff --git a/net/bluetooth/bnep/sock.c b/net/bluetooth/bnep/sock.c
index 2bfe796cf05d..28c55835422a 100644
--- a/net/bluetooth/bnep/sock.c
+++ b/net/bluetooth/bnep/sock.c
@@ -28,7 +28,6 @@
28 * $Id: sock.c,v 1.4 2002/08/04 21:23:58 maxk Exp $ 28 * $Id: sock.c,v 1.4 2002/08/04 21:23:58 maxk Exp $
29 */ 29 */
30 30
31#include <linux/config.h>
32#include <linux/module.h> 31#include <linux/module.h>
33 32
34#include <linux/types.h> 33#include <linux/types.h>
diff --git a/net/bluetooth/cmtp/capi.c b/net/bluetooth/cmtp/capi.c
index b2e7e38531c6..6fb47e00e188 100644
--- a/net/bluetooth/cmtp/capi.c
+++ b/net/bluetooth/cmtp/capi.c
@@ -20,7 +20,6 @@
20 SOFTWARE IS DISCLAIMED. 20 SOFTWARE IS DISCLAIMED.
21*/ 21*/
22 22
23#include <linux/config.h>
24#include <linux/module.h> 23#include <linux/module.h>
25 24
26#include <linux/types.h> 25#include <linux/types.h>
diff --git a/net/bluetooth/cmtp/core.c b/net/bluetooth/cmtp/core.c
index 901eff7ebe74..182254a580e2 100644
--- a/net/bluetooth/cmtp/core.c
+++ b/net/bluetooth/cmtp/core.c
@@ -20,7 +20,6 @@
20 SOFTWARE IS DISCLAIMED. 20 SOFTWARE IS DISCLAIMED.
21*/ 21*/
22 22
23#include <linux/config.h>
24#include <linux/module.h> 23#include <linux/module.h>
25 24
26#include <linux/types.h> 25#include <linux/types.h>
diff --git a/net/bluetooth/cmtp/sock.c b/net/bluetooth/cmtp/sock.c
index 8f8fad23f78a..10ad7fd91d83 100644
--- a/net/bluetooth/cmtp/sock.c
+++ b/net/bluetooth/cmtp/sock.c
@@ -20,7 +20,6 @@
20 SOFTWARE IS DISCLAIMED. 20 SOFTWARE IS DISCLAIMED.
21*/ 21*/
22 22
23#include <linux/config.h>
24#include <linux/module.h> 23#include <linux/module.h>
25 24
26#include <linux/types.h> 25#include <linux/types.h>
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index f812ed129e58..5c0c2b1ef34a 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -24,7 +24,6 @@
24 24
25/* Bluetooth HCI connection handling. */ 25/* Bluetooth HCI connection handling. */
26 26
27#include <linux/config.h>
28#include <linux/module.h> 27#include <linux/module.h>
29 28
30#include <linux/types.h> 29#include <linux/types.h>
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index a49a6975092d..f67240beb0dd 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -24,7 +24,6 @@
24 24
25/* Bluetooth HCI core. */ 25/* Bluetooth HCI core. */
26 26
27#include <linux/config.h>
28#include <linux/module.h> 27#include <linux/module.h>
29#include <linux/kmod.h> 28#include <linux/kmod.h>
30 29
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index eb64555d1fb3..618bacee1b1c 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -24,7 +24,6 @@
24 24
25/* Bluetooth HCI event handling. */ 25/* Bluetooth HCI event handling. */
26 26
27#include <linux/config.h>
28#include <linux/module.h> 27#include <linux/module.h>
29 28
30#include <linux/types.h> 29#include <linux/types.h>
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index 97bdec73d17e..1a35d343e08a 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -24,7 +24,6 @@
24 24
25/* Bluetooth HCI sockets. */ 25/* Bluetooth HCI sockets. */
26 26
27#include <linux/config.h>
28#include <linux/module.h> 27#include <linux/module.h>
29 28
30#include <linux/types.h> 29#include <linux/types.h>
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
index 0ed38740388c..19b234c86f33 100644
--- a/net/bluetooth/hci_sysfs.c
+++ b/net/bluetooth/hci_sysfs.c
@@ -1,6 +1,5 @@
1/* Bluetooth HCI driver model support. */ 1/* Bluetooth HCI driver model support. */
2 2
3#include <linux/config.h>
4#include <linux/kernel.h> 3#include <linux/kernel.h>
5#include <linux/init.h> 4#include <linux/init.h>
6 5
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
index cdb9cfafd960..b9c24a55425c 100644
--- a/net/bluetooth/hidp/core.c
+++ b/net/bluetooth/hidp/core.c
@@ -20,7 +20,6 @@
20 SOFTWARE IS DISCLAIMED. 20 SOFTWARE IS DISCLAIMED.
21*/ 21*/
22 22
23#include <linux/config.h>
24#include <linux/module.h> 23#include <linux/module.h>
25 24
26#include <linux/types.h> 25#include <linux/types.h>
diff --git a/net/bluetooth/hidp/sock.c b/net/bluetooth/hidp/sock.c
index b8f67761b886..099646e4e2ef 100644
--- a/net/bluetooth/hidp/sock.c
+++ b/net/bluetooth/hidp/sock.c
@@ -20,7 +20,6 @@
20 SOFTWARE IS DISCLAIMED. 20 SOFTWARE IS DISCLAIMED.
21*/ 21*/
22 22
23#include <linux/config.h>
24#include <linux/module.h> 23#include <linux/module.h>
25 24
26#include <linux/types.h> 25#include <linux/types.h>
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index f6b4a8085357..770101177da1 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -24,7 +24,6 @@
24 24
25/* Bluetooth L2CAP core and sockets. */ 25/* Bluetooth L2CAP core and sockets. */
26 26
27#include <linux/config.h>
28#include <linux/module.h> 27#include <linux/module.h>
29 28
30#include <linux/types.h> 29#include <linux/types.h>
diff --git a/net/bluetooth/lib.c b/net/bluetooth/lib.c
index ee6a66979913..e5fd0cb70ae9 100644
--- a/net/bluetooth/lib.c
+++ b/net/bluetooth/lib.c
@@ -24,7 +24,6 @@
24 24
25/* Bluetooth kernel library. */ 25/* Bluetooth kernel library. */
26 26
27#include <linux/config.h>
28#include <linux/module.h> 27#include <linux/module.h>
29 28
30#include <linux/kernel.h> 29#include <linux/kernel.h>
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
index e99010ce8bb2..bd46e8927f29 100644
--- a/net/bluetooth/rfcomm/core.c
+++ b/net/bluetooth/rfcomm/core.c
@@ -27,7 +27,6 @@
27 * $Id: core.c,v 1.42 2002/10/01 23:26:25 maxk Exp $ 27 * $Id: core.c,v 1.42 2002/10/01 23:26:25 maxk Exp $
28 */ 28 */
29 29
30#include <linux/config.h>
31#include <linux/module.h> 30#include <linux/module.h>
32#include <linux/errno.h> 31#include <linux/errno.h>
33#include <linux/kernel.h> 32#include <linux/kernel.h>
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c
index 757d2dd3b02f..4e9962c8cfa6 100644
--- a/net/bluetooth/rfcomm/sock.c
+++ b/net/bluetooth/rfcomm/sock.c
@@ -27,7 +27,6 @@
27 * $Id: sock.c,v 1.24 2002/10/03 01:00:34 maxk Exp $ 27 * $Id: sock.c,v 1.24 2002/10/03 01:00:34 maxk Exp $
28 */ 28 */
29 29
30#include <linux/config.h>
31#include <linux/module.h> 30#include <linux/module.h>
32 31
33#include <linux/types.h> 32#include <linux/types.h>
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
index b105a715fa93..2ff2d5b87c93 100644
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
@@ -27,7 +27,6 @@
27 * $Id: tty.c,v 1.24 2002/10/03 01:54:38 holtmann Exp $ 27 * $Id: tty.c,v 1.24 2002/10/03 01:54:38 holtmann Exp $
28 */ 28 */
29 29
30#include <linux/config.h>
31#include <linux/module.h> 30#include <linux/module.h>
32 31
33#include <linux/tty.h> 32#include <linux/tty.h>
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index 0c2d13ad69bb..a5f1e44db5d3 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -24,7 +24,6 @@
24 24
25/* Bluetooth SCO sockets. */ 25/* Bluetooth SCO sockets. */
26 26
27#include <linux/config.h>
28#include <linux/module.h> 27#include <linux/module.h>
29 28
30#include <linux/types.h> 29#include <linux/types.h>
diff --git a/net/bridge/br.c b/net/bridge/br.c
index 654401ceb2db..2994387999a8 100644
--- a/net/bridge/br.c
+++ b/net/bridge/br.c
@@ -13,7 +13,6 @@
13 * 2 of the License, or (at your option) any later version. 13 * 2 of the License, or (at your option) any later version.
14 */ 14 */
15 15
16#include <linux/config.h>
17#include <linux/module.h> 16#include <linux/module.h>
18#include <linux/kernel.h> 17#include <linux/kernel.h>
19#include <linux/netdevice.h> 18#include <linux/netdevice.h>
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index 2afdc7c0736c..f8dbcee80eba 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -184,6 +184,6 @@ void br_dev_setup(struct net_device *dev)
184 dev->set_mac_address = br_set_mac_address; 184 dev->set_mac_address = br_set_mac_address;
185 dev->priv_flags = IFF_EBRIDGE; 185 dev->priv_flags = IFF_EBRIDGE;
186 186
187 dev->features = NETIF_F_SG | NETIF_F_FRAGLIST 187 dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA |
188 | NETIF_F_HIGHDMA | NETIF_F_TSO | NETIF_F_NO_CSUM; 188 NETIF_F_TSO | NETIF_F_NO_CSUM | NETIF_F_GSO_ROBUST;
189} 189}
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 07956ecf545e..f55ef682ef84 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -392,7 +392,8 @@ void br_features_recompute(struct net_bridge *br)
392 features &= feature; 392 features &= feature;
393 } 393 }
394 394
395 br->dev->features = features | checksum | NETIF_F_LLTX; 395 br->dev->features = features | checksum | NETIF_F_LLTX |
396 NETIF_F_GSO_ROBUST;
396} 397}
397 398
398/* called with RTNL */ 399/* called with RTNL */
diff --git a/net/bridge/netfilter/ebt_ulog.c b/net/bridge/netfilter/ebt_ulog.c
index ee5a51761260..02693a230dc1 100644
--- a/net/bridge/netfilter/ebt_ulog.c
+++ b/net/bridge/netfilter/ebt_ulog.c
@@ -29,7 +29,6 @@
29 */ 29 */
30 30
31#include <linux/module.h> 31#include <linux/module.h>
32#include <linux/config.h>
33#include <linux/spinlock.h> 32#include <linux/spinlock.h>
34#include <linux/socket.h> 33#include <linux/socket.h>
35#include <linux/skbuff.h> 34#include <linux/skbuff.h>
diff --git a/net/core/dev.c b/net/core/dev.c
index f1c52cbd6ef7..066a60a75280 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -76,7 +76,6 @@
76#include <asm/system.h> 76#include <asm/system.h>
77#include <linux/bitops.h> 77#include <linux/bitops.h>
78#include <linux/capability.h> 78#include <linux/capability.h>
79#include <linux/config.h>
80#include <linux/cpu.h> 79#include <linux/cpu.h>
81#include <linux/types.h> 80#include <linux/types.h>
82#include <linux/kernel.h> 81#include <linux/kernel.h>
@@ -1190,11 +1189,14 @@ out:
1190/** 1189/**
1191 * skb_gso_segment - Perform segmentation on skb. 1190 * skb_gso_segment - Perform segmentation on skb.
1192 * @skb: buffer to segment 1191 * @skb: buffer to segment
1193 * @sg: whether scatter-gather is supported on the target. 1192 * @features: features for the output path (see dev->features)
1194 * 1193 *
1195 * This function segments the given skb and returns a list of segments. 1194 * This function segments the given skb and returns a list of segments.
1195 *
1196 * It may return NULL if the skb requires no segmentation. This is
1197 * only possible when GSO is used for verifying header integrity.
1196 */ 1198 */
1197struct sk_buff *skb_gso_segment(struct sk_buff *skb, int sg) 1199struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features)
1198{ 1200{
1199 struct sk_buff *segs = ERR_PTR(-EPROTONOSUPPORT); 1201 struct sk_buff *segs = ERR_PTR(-EPROTONOSUPPORT);
1200 struct packet_type *ptype; 1202 struct packet_type *ptype;
@@ -1210,12 +1212,14 @@ struct sk_buff *skb_gso_segment(struct sk_buff *skb, int sg)
1210 rcu_read_lock(); 1212 rcu_read_lock();
1211 list_for_each_entry_rcu(ptype, &ptype_base[ntohs(type) & 15], list) { 1213 list_for_each_entry_rcu(ptype, &ptype_base[ntohs(type) & 15], list) {
1212 if (ptype->type == type && !ptype->dev && ptype->gso_segment) { 1214 if (ptype->type == type && !ptype->dev && ptype->gso_segment) {
1213 segs = ptype->gso_segment(skb, sg); 1215 segs = ptype->gso_segment(skb, features);
1214 break; 1216 break;
1215 } 1217 }
1216 } 1218 }
1217 rcu_read_unlock(); 1219 rcu_read_unlock();
1218 1220
1221 __skb_push(skb, skb->data - skb->mac.raw);
1222
1219 return segs; 1223 return segs;
1220} 1224}
1221 1225
@@ -1234,7 +1238,6 @@ void netdev_rx_csum_fault(struct net_device *dev)
1234EXPORT_SYMBOL(netdev_rx_csum_fault); 1238EXPORT_SYMBOL(netdev_rx_csum_fault);
1235#endif 1239#endif
1236 1240
1237#ifdef CONFIG_HIGHMEM
1238/* Actually, we should eliminate this check as soon as we know, that: 1241/* Actually, we should eliminate this check as soon as we know, that:
1239 * 1. IOMMU is present and allows to map all the memory. 1242 * 1. IOMMU is present and allows to map all the memory.
1240 * 2. No high memory really exists on this machine. 1243 * 2. No high memory really exists on this machine.
@@ -1242,6 +1245,7 @@ EXPORT_SYMBOL(netdev_rx_csum_fault);
1242 1245
1243static inline int illegal_highdma(struct net_device *dev, struct sk_buff *skb) 1246static inline int illegal_highdma(struct net_device *dev, struct sk_buff *skb)
1244{ 1247{
1248#ifdef CONFIG_HIGHMEM
1245 int i; 1249 int i;
1246 1250
1247 if (dev->features & NETIF_F_HIGHDMA) 1251 if (dev->features & NETIF_F_HIGHDMA)
@@ -1251,11 +1255,9 @@ static inline int illegal_highdma(struct net_device *dev, struct sk_buff *skb)
1251 if (PageHighMem(skb_shinfo(skb)->frags[i].page)) 1255 if (PageHighMem(skb_shinfo(skb)->frags[i].page))
1252 return 1; 1256 return 1;
1253 1257
1258#endif
1254 return 0; 1259 return 0;
1255} 1260}
1256#else
1257#define illegal_highdma(dev, skb) (0)
1258#endif
1259 1261
1260struct dev_gso_cb { 1262struct dev_gso_cb {
1261 void (*destructor)(struct sk_buff *skb); 1263 void (*destructor)(struct sk_buff *skb);
@@ -1291,9 +1293,15 @@ static int dev_gso_segment(struct sk_buff *skb)
1291{ 1293{
1292 struct net_device *dev = skb->dev; 1294 struct net_device *dev = skb->dev;
1293 struct sk_buff *segs; 1295 struct sk_buff *segs;
1296 int features = dev->features & ~(illegal_highdma(dev, skb) ?
1297 NETIF_F_SG : 0);
1298
1299 segs = skb_gso_segment(skb, features);
1300
1301 /* Verifying header integrity only. */
1302 if (!segs)
1303 return 0;
1294 1304
1295 segs = skb_gso_segment(skb, dev->features & NETIF_F_SG &&
1296 !illegal_highdma(dev, skb));
1297 if (unlikely(IS_ERR(segs))) 1305 if (unlikely(IS_ERR(segs)))
1298 return PTR_ERR(segs); 1306 return PTR_ERR(segs);
1299 1307
@@ -1310,13 +1318,17 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
1310 if (netdev_nit) 1318 if (netdev_nit)
1311 dev_queue_xmit_nit(skb, dev); 1319 dev_queue_xmit_nit(skb, dev);
1312 1320
1313 if (!netif_needs_gso(dev, skb)) 1321 if (netif_needs_gso(dev, skb)) {
1314 return dev->hard_start_xmit(skb, dev); 1322 if (unlikely(dev_gso_segment(skb)))
1323 goto out_kfree_skb;
1324 if (skb->next)
1325 goto gso;
1326 }
1315 1327
1316 if (unlikely(dev_gso_segment(skb))) 1328 return dev->hard_start_xmit(skb, dev);
1317 goto out_kfree_skb;
1318 } 1329 }
1319 1330
1331gso:
1320 do { 1332 do {
1321 struct sk_buff *nskb = skb->next; 1333 struct sk_buff *nskb = skb->next;
1322 int rc; 1334 int rc;
diff --git a/net/core/link_watch.c b/net/core/link_watch.c
index 0f37266411b5..4b36114744c5 100644
--- a/net/core/link_watch.c
+++ b/net/core/link_watch.c
@@ -11,7 +11,6 @@
11 * 11 *
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/module.h> 14#include <linux/module.h>
16#include <linux/netdevice.h> 15#include <linux/netdevice.h>
17#include <linux/if.h> 16#include <linux/if.h>
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 50a8c73caf97..7ad681f5e712 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -15,7 +15,6 @@
15 * Harald Welte Add neighbour cache statistics like rtstat 15 * Harald Welte Add neighbour cache statistics like rtstat
16 */ 16 */
17 17
18#include <linux/config.h>
19#include <linux/types.h> 18#include <linux/types.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
21#include <linux/module.h> 20#include <linux/module.h>
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 47a6fceb6771..13472762b18b 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -10,7 +10,6 @@
10 */ 10 */
11 11
12#include <linux/capability.h> 12#include <linux/capability.h>
13#include <linux/config.h>
14#include <linux/kernel.h> 13#include <linux/kernel.h>
15#include <linux/netdevice.h> 14#include <linux/netdevice.h>
16#include <linux/if_arp.h> 15#include <linux/if_arp.h>
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 3fcfa9c59e1f..20e5bb73f147 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -16,7 +16,6 @@
16 * Vitaly E. Lavrov RTA_OK arithmetics was wrong. 16 * Vitaly E. Lavrov RTA_OK arithmetics was wrong.
17 */ 17 */
18 18
19#include <linux/config.h>
20#include <linux/errno.h> 19#include <linux/errno.h>
21#include <linux/module.h> 20#include <linux/module.h>
22#include <linux/types.h> 21#include <linux/types.h>
@@ -663,7 +662,7 @@ rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, int *errp)
663 sz_idx = type>>2; 662 sz_idx = type>>2;
664 kind = type&3; 663 kind = type&3;
665 664
666 if (kind != 2 && security_netlink_recv(skb)) { 665 if (kind != 2 && security_netlink_recv(skb, CAP_NET_ADMIN)) {
667 *errp = -EPERM; 666 *errp = -EPERM;
668 return -1; 667 return -1;
669 } 668 }
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 6edbb90cbcec..7cfbdb215ba2 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -38,7 +38,6 @@
38 * The functions in this file will not compile correctly with gcc 2.4.x 38 * The functions in this file will not compile correctly with gcc 2.4.x
39 */ 39 */
40 40
41#include <linux/config.h>
42#include <linux/module.h> 41#include <linux/module.h>
43#include <linux/types.h> 42#include <linux/types.h>
44#include <linux/kernel.h> 43#include <linux/kernel.h>
@@ -272,7 +271,7 @@ static void skb_clone_fraglist(struct sk_buff *skb)
272 skb_get(list); 271 skb_get(list);
273} 272}
274 273
275void skb_release_data(struct sk_buff *skb) 274static void skb_release_data(struct sk_buff *skb)
276{ 275{
277 if (!skb->cloned || 276 if (!skb->cloned ||
278 !atomic_sub_return(skb->nohdr ? (1 << SKB_DATAREF_SHIFT) + 1 : 1, 277 !atomic_sub_return(skb->nohdr ? (1 << SKB_DATAREF_SHIFT) + 1 : 1,
@@ -1848,13 +1847,13 @@ EXPORT_SYMBOL_GPL(skb_pull_rcsum);
1848/** 1847/**
1849 * skb_segment - Perform protocol segmentation on skb. 1848 * skb_segment - Perform protocol segmentation on skb.
1850 * @skb: buffer to segment 1849 * @skb: buffer to segment
1851 * @sg: whether scatter-gather can be used for generated segments 1850 * @features: features for the output path (see dev->features)
1852 * 1851 *
1853 * This function performs segmentation on the given skb. It returns 1852 * This function performs segmentation on the given skb. It returns
1854 * the segment at the given position. It returns NULL if there are 1853 * the segment at the given position. It returns NULL if there are
1855 * no more segments to generate, or when an error is encountered. 1854 * no more segments to generate, or when an error is encountered.
1856 */ 1855 */
1857struct sk_buff *skb_segment(struct sk_buff *skb, int sg) 1856struct sk_buff *skb_segment(struct sk_buff *skb, int features)
1858{ 1857{
1859 struct sk_buff *segs = NULL; 1858 struct sk_buff *segs = NULL;
1860 struct sk_buff *tail = NULL; 1859 struct sk_buff *tail = NULL;
@@ -1863,6 +1862,7 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int sg)
1863 unsigned int offset = doffset; 1862 unsigned int offset = doffset;
1864 unsigned int headroom; 1863 unsigned int headroom;
1865 unsigned int len; 1864 unsigned int len;
1865 int sg = features & NETIF_F_SG;
1866 int nfrags = skb_shinfo(skb)->nr_frags; 1866 int nfrags = skb_shinfo(skb)->nr_frags;
1867 int err = -ENOMEM; 1867 int err = -ENOMEM;
1868 int i = 0; 1868 int i = 0;
diff --git a/net/core/sock.c b/net/core/sock.c
index 5d820c376653..533b9317144b 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -92,7 +92,6 @@
92 */ 92 */
93 93
94#include <linux/capability.h> 94#include <linux/capability.h>
95#include <linux/config.h>
96#include <linux/errno.h> 95#include <linux/errno.h>
97#include <linux/types.h> 96#include <linux/types.h>
98#include <linux/socket.h> 97#include <linux/socket.h>
@@ -565,6 +564,13 @@ set_rcvbuf:
565 ret = -ENONET; 564 ret = -ENONET;
566 break; 565 break;
567 566
567 case SO_PASSSEC:
568 if (valbool)
569 set_bit(SOCK_PASSSEC, &sock->flags);
570 else
571 clear_bit(SOCK_PASSSEC, &sock->flags);
572 break;
573
568 /* We implement the SO_SNDLOWAT etc to 574 /* We implement the SO_SNDLOWAT etc to
569 not be settable (1003.1g 5.3) */ 575 not be settable (1003.1g 5.3) */
570 default: 576 default:
@@ -723,6 +729,10 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
723 v.val = sk->sk_state == TCP_LISTEN; 729 v.val = sk->sk_state == TCP_LISTEN;
724 break; 730 break;
725 731
732 case SO_PASSSEC:
733 v.val = test_bit(SOCK_PASSSEC, &sock->flags) ? 1 : 0;
734 break;
735
726 case SO_PEERSEC: 736 case SO_PEERSEC:
727 return security_socket_getpeersec_stream(sock, optval, optlen, len); 737 return security_socket_getpeersec_stream(sock, optval, optlen, len);
728 738
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
index 710453656721..02534131d88e 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -7,7 +7,6 @@
7 7
8#include <linux/mm.h> 8#include <linux/mm.h>
9#include <linux/sysctl.h> 9#include <linux/sysctl.h>
10#include <linux/config.h>
11#include <linux/module.h> 10#include <linux/module.h>
12#include <linux/socket.h> 11#include <linux/socket.h>
13#include <net/sock.h> 12#include <net/sock.h>
diff --git a/net/dccp/ackvec.h b/net/dccp/ackvec.h
index ec7a89bb7b39..0adf4b56c34c 100644
--- a/net/dccp/ackvec.h
+++ b/net/dccp/ackvec.h
@@ -11,7 +11,6 @@
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/compiler.h> 14#include <linux/compiler.h>
16#include <linux/list.h> 15#include <linux/list.h>
17#include <linux/time.h> 16#include <linux/time.h>
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c
index d4f9e2d33453..e9615627dcd6 100644
--- a/net/dccp/ccids/ccid2.c
+++ b/net/dccp/ccids/ccid2.c
@@ -30,7 +30,6 @@
30 * - jiffies wrapping 30 * - jiffies wrapping
31 */ 31 */
32 32
33#include <linux/config.h>
34#include "../ccid.h" 33#include "../ccid.h"
35#include "../dccp.h" 34#include "../dccp.h"
36#include "ccid2.h" 35#include "ccid2.h"
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index b4a51d0355a5..c39bff706cfc 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -34,7 +34,6 @@
34 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 34 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
35 */ 35 */
36 36
37#include <linux/config.h>
38#include "../ccid.h" 37#include "../ccid.h"
39#include "../dccp.h" 38#include "../dccp.h"
40#include "lib/packet_history.h" 39#include "lib/packet_history.h"
diff --git a/net/dccp/ccids/ccid3.h b/net/dccp/ccids/ccid3.h
index f18b96d4e5a2..5ade4f668b22 100644
--- a/net/dccp/ccids/ccid3.h
+++ b/net/dccp/ccids/ccid3.h
@@ -36,7 +36,6 @@
36#ifndef _DCCP_CCID3_H_ 36#ifndef _DCCP_CCID3_H_
37#define _DCCP_CCID3_H_ 37#define _DCCP_CCID3_H_
38 38
39#include <linux/config.h>
40#include <linux/list.h> 39#include <linux/list.h>
41#include <linux/time.h> 40#include <linux/time.h>
42#include <linux/types.h> 41#include <linux/types.h>
diff --git a/net/dccp/ccids/lib/loss_interval.c b/net/dccp/ccids/lib/loss_interval.c
index 4c01a54143ad..5d7b7d864385 100644
--- a/net/dccp/ccids/lib/loss_interval.c
+++ b/net/dccp/ccids/lib/loss_interval.c
@@ -11,7 +11,6 @@
11 * (at your option) any later version. 11 * (at your option) any later version.
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/module.h> 14#include <linux/module.h>
16 15
17#include "loss_interval.h" 16#include "loss_interval.h"
diff --git a/net/dccp/ccids/lib/loss_interval.h b/net/dccp/ccids/lib/loss_interval.h
index 417d9d82df3e..43bf78269d1d 100644
--- a/net/dccp/ccids/lib/loss_interval.h
+++ b/net/dccp/ccids/lib/loss_interval.h
@@ -13,7 +13,6 @@
13 * any later version. 13 * any later version.
14 */ 14 */
15 15
16#include <linux/config.h>
17#include <linux/list.h> 16#include <linux/list.h>
18#include <linux/slab.h> 17#include <linux/slab.h>
19#include <linux/time.h> 18#include <linux/time.h>
diff --git a/net/dccp/ccids/lib/packet_history.c b/net/dccp/ccids/lib/packet_history.c
index d3f9d2053830..ad98d6a322eb 100644
--- a/net/dccp/ccids/lib/packet_history.c
+++ b/net/dccp/ccids/lib/packet_history.c
@@ -34,7 +34,6 @@
34 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 34 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
35 */ 35 */
36 36
37#include <linux/config.h>
38#include <linux/module.h> 37#include <linux/module.h>
39#include <linux/string.h> 38#include <linux/string.h>
40 39
diff --git a/net/dccp/ccids/lib/packet_history.h b/net/dccp/ccids/lib/packet_history.h
index 122e96737ff6..673c209e4e85 100644
--- a/net/dccp/ccids/lib/packet_history.h
+++ b/net/dccp/ccids/lib/packet_history.h
@@ -37,7 +37,6 @@
37#ifndef _DCCP_PKT_HIST_ 37#ifndef _DCCP_PKT_HIST_
38#define _DCCP_PKT_HIST_ 38#define _DCCP_PKT_HIST_
39 39
40#include <linux/config.h>
41#include <linux/list.h> 40#include <linux/list.h>
42#include <linux/slab.h> 41#include <linux/slab.h>
43#include <linux/time.h> 42#include <linux/time.h>
diff --git a/net/dccp/ccids/lib/tfrc_equation.c b/net/dccp/ccids/lib/tfrc_equation.c
index add3cae65e2d..4fd2ebebf5a0 100644
--- a/net/dccp/ccids/lib/tfrc_equation.c
+++ b/net/dccp/ccids/lib/tfrc_equation.c
@@ -12,7 +12,6 @@
12 * (at your option) any later version. 12 * (at your option) any later version.
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/module.h> 15#include <linux/module.h>
17 16
18#include <asm/div64.h> 17#include <asm/div64.h>
diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h
index 1fe509148689..d00a2f4ee5dd 100644
--- a/net/dccp/dccp.h
+++ b/net/dccp/dccp.h
@@ -12,7 +12,6 @@
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/dccp.h> 15#include <linux/dccp.h>
17#include <net/snmp.h> 16#include <net/snmp.h>
18#include <net/sock.h> 17#include <net/sock.h>
diff --git a/net/dccp/diag.c b/net/dccp/diag.c
index 0f25dc395967..0f3745585a94 100644
--- a/net/dccp/diag.c
+++ b/net/dccp/diag.c
@@ -9,7 +9,6 @@
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11 11
12#include <linux/config.h>
13 12
14#include <linux/module.h> 13#include <linux/module.h>
15#include <linux/inet_diag.h> 14#include <linux/inet_diag.h>
diff --git a/net/dccp/feat.c b/net/dccp/feat.c
index b39e2a597889..a1b0682ee77c 100644
--- a/net/dccp/feat.c
+++ b/net/dccp/feat.c
@@ -10,7 +10,6 @@
10 * 2 of the License, or (at your option) any later version. 10 * 2 of the License, or (at your option) any later version.
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/module.h> 13#include <linux/module.h>
15 14
16#include "dccp.h" 15#include "dccp.h"
diff --git a/net/dccp/input.c b/net/dccp/input.c
index bfc53665516b..7f9dc6ac58c9 100644
--- a/net/dccp/input.c
+++ b/net/dccp/input.c
@@ -10,7 +10,6 @@
10 * 2 of the License, or (at your option) any later version. 10 * 2 of the License, or (at your option) any later version.
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/dccp.h> 13#include <linux/dccp.h>
15#include <linux/skbuff.h> 14#include <linux/skbuff.h>
16 15
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index f2c011fd2ba1..c3073e7e81d3 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -10,7 +10,6 @@
10 * 2 of the License, or (at your option) any later version. 10 * 2 of the License, or (at your option) any later version.
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/dccp.h> 13#include <linux/dccp.h>
15#include <linux/icmp.h> 14#include <linux/icmp.h>
16#include <linux/module.h> 15#include <linux/module.h>
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index 65e2ab0886e6..ff42bc43263d 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -12,7 +12,6 @@
12 * 2 of the License, or (at your option) any later version. 12 * 2 of the License, or (at your option) any later version.
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/module.h> 15#include <linux/module.h>
17#include <linux/random.h> 16#include <linux/random.h>
18#include <linux/xfrm.h> 17#include <linux/xfrm.h>
diff --git a/net/dccp/ipv6.h b/net/dccp/ipv6.h
index e4d4e9309270..6eef81fdbe56 100644
--- a/net/dccp/ipv6.h
+++ b/net/dccp/ipv6.h
@@ -11,7 +11,6 @@
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/dccp.h> 14#include <linux/dccp.h>
16#include <linux/ipv6.h> 15#include <linux/ipv6.h>
17 16
diff --git a/net/dccp/minisocks.c b/net/dccp/minisocks.c
index c0349e5b0551..9045438d6b36 100644
--- a/net/dccp/minisocks.c
+++ b/net/dccp/minisocks.c
@@ -10,7 +10,6 @@
10 * 2 of the License, or (at your option) any later version. 10 * 2 of the License, or (at your option) any later version.
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/dccp.h> 13#include <linux/dccp.h>
15#include <linux/skbuff.h> 14#include <linux/skbuff.h>
16#include <linux/timer.h> 15#include <linux/timer.h>
diff --git a/net/dccp/options.c b/net/dccp/options.c
index e9feb2a0c770..c3cda1e39aa8 100644
--- a/net/dccp/options.c
+++ b/net/dccp/options.c
@@ -11,7 +11,6 @@
11 * as published by the Free Software Foundation; either version 11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version. 12 * 2 of the License, or (at your option) any later version.
13 */ 13 */
14#include <linux/config.h>
15#include <linux/dccp.h> 14#include <linux/dccp.h>
16#include <linux/module.h> 15#include <linux/module.h>
17#include <linux/types.h> 16#include <linux/types.h>
diff --git a/net/dccp/output.c b/net/dccp/output.c
index 7409e4a3abdf..58669beee132 100644
--- a/net/dccp/output.c
+++ b/net/dccp/output.c
@@ -10,7 +10,6 @@
10 * 2 of the License, or (at your option) any later version. 10 * 2 of the License, or (at your option) any later version.
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/dccp.h> 13#include <linux/dccp.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
16#include <linux/skbuff.h> 15#include <linux/skbuff.h>
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index 5317fd3e6691..f4f0627ea41c 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -9,7 +9,6 @@
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/dccp.h> 12#include <linux/dccp.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <linux/types.h> 14#include <linux/types.h>
diff --git a/net/dccp/sysctl.c b/net/dccp/sysctl.c
index 64c89e9c229e..c1ba9451bc3d 100644
--- a/net/dccp/sysctl.c
+++ b/net/dccp/sysctl.c
@@ -9,7 +9,6 @@
9 * as published by the Free Software Foundation. 9 * as published by the Free Software Foundation.
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/mm.h> 12#include <linux/mm.h>
14#include <linux/sysctl.h> 13#include <linux/sysctl.h>
15 14
diff --git a/net/dccp/timer.c b/net/dccp/timer.c
index 5244415e5f18..8447742f5615 100644
--- a/net/dccp/timer.c
+++ b/net/dccp/timer.c
@@ -10,7 +10,6 @@
10 * 2 of the License, or (at your option) any later version. 10 * 2 of the License, or (at your option) any later version.
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/dccp.h> 13#include <linux/dccp.h>
15#include <linux/skbuff.h> 14#include <linux/skbuff.h>
16 15
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
index 2b289ef20ab3..5486247735f6 100644
--- a/net/decnet/af_decnet.c
+++ b/net/decnet/af_decnet.c
@@ -99,7 +99,6 @@ Version 0.0.6 2.1.110 07-aug-98 Eduardo Marcelo Serrat
99 dn_bind fixes 99 dn_bind fixes
100*******************************************************************************/ 100*******************************************************************************/
101 101
102#include <linux/config.h>
103#include <linux/module.h> 102#include <linux/module.h>
104#include <linux/errno.h> 103#include <linux/errno.h>
105#include <linux/types.h> 104#include <linux/types.h>
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
index a26ff9f44576..98a25208440d 100644
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -24,7 +24,6 @@
24 * devices. All mtu based now. 24 * devices. All mtu based now.
25 */ 25 */
26 26
27#include <linux/config.h>
28#include <linux/capability.h> 27#include <linux/capability.h>
29#include <linux/module.h> 28#include <linux/module.h>
30#include <linux/moduleparam.h> 29#include <linux/moduleparam.h>
diff --git a/net/decnet/dn_fib.c b/net/decnet/dn_fib.c
index bd4ce8681a12..0375077391b7 100644
--- a/net/decnet/dn_fib.c
+++ b/net/decnet/dn_fib.c
@@ -17,7 +17,6 @@
17 * this code was copied from it. 17 * this code was copied from it.
18 * 18 *
19 */ 19 */
20#include <linux/config.h>
21#include <linux/string.h> 20#include <linux/string.h>
22#include <linux/net.h> 21#include <linux/net.h>
23#include <linux/socket.h> 22#include <linux/socket.h>
diff --git a/net/decnet/dn_neigh.c b/net/decnet/dn_neigh.c
index 66e230c3b328..5ce9c9e0565c 100644
--- a/net/decnet/dn_neigh.c
+++ b/net/decnet/dn_neigh.c
@@ -24,7 +24,6 @@
24 * 24 *
25 */ 25 */
26 26
27#include <linux/config.h>
28#include <linux/net.h> 27#include <linux/net.h>
29#include <linux/module.h> 28#include <linux/module.h>
30#include <linux/socket.h> 29#include <linux/socket.h>
diff --git a/net/decnet/dn_nsp_in.c b/net/decnet/dn_nsp_in.c
index a2ba9db1c376..86f7f3b28e70 100644
--- a/net/decnet/dn_nsp_in.c
+++ b/net/decnet/dn_nsp_in.c
@@ -45,7 +45,6 @@
45 GNU General Public License for more details. 45 GNU General Public License for more details.
46*******************************************************************************/ 46*******************************************************************************/
47 47
48#include <linux/config.h>
49#include <linux/errno.h> 48#include <linux/errno.h>
50#include <linux/types.h> 49#include <linux/types.h>
51#include <linux/socket.h> 50#include <linux/socket.h>
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index 5abf7057af00..1355614ec11b 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -55,7 +55,6 @@
55 GNU General Public License for more details. 55 GNU General Public License for more details.
56*******************************************************************************/ 56*******************************************************************************/
57 57
58#include <linux/config.h>
59#include <linux/errno.h> 58#include <linux/errno.h>
60#include <linux/types.h> 59#include <linux/types.h>
61#include <linux/socket.h> 60#include <linux/socket.h>
diff --git a/net/decnet/dn_rules.c b/net/decnet/dn_rules.c
index 446faafe2065..06e785fe5757 100644
--- a/net/decnet/dn_rules.c
+++ b/net/decnet/dn_rules.c
@@ -13,7 +13,6 @@
13 * Changes: 13 * Changes:
14 * 14 *
15 */ 15 */
16#include <linux/config.h>
17#include <linux/string.h> 16#include <linux/string.h>
18#include <linux/net.h> 17#include <linux/net.h>
19#include <linux/socket.h> 18#include <linux/socket.h>
diff --git a/net/decnet/dn_table.c b/net/decnet/dn_table.c
index 0ebc46af1bdd..37d9d0a1ac8c 100644
--- a/net/decnet/dn_table.c
+++ b/net/decnet/dn_table.c
@@ -12,7 +12,6 @@
12 * Changes: 12 * Changes:
13 * 13 *
14 */ 14 */
15#include <linux/config.h>
16#include <linux/string.h> 15#include <linux/string.h>
17#include <linux/net.h> 16#include <linux/net.h>
18#include <linux/socket.h> 17#include <linux/socket.h>
diff --git a/net/decnet/netfilter/dn_rtmsg.c b/net/decnet/netfilter/dn_rtmsg.c
index 74133ecd7700..8b99bd33540d 100644
--- a/net/decnet/netfilter/dn_rtmsg.c
+++ b/net/decnet/netfilter/dn_rtmsg.c
@@ -107,7 +107,7 @@ static inline void dnrmg_receive_user_skb(struct sk_buff *skb)
107 if (nlh->nlmsg_len < sizeof(*nlh) || skb->len < nlh->nlmsg_len) 107 if (nlh->nlmsg_len < sizeof(*nlh) || skb->len < nlh->nlmsg_len)
108 return; 108 return;
109 109
110 if (!cap_raised(NETLINK_CB(skb).eff_cap, CAP_NET_ADMIN)) 110 if (security_netlink_recv(skb, CAP_NET_ADMIN))
111 RCV_SKB_FAIL(-EPERM); 111 RCV_SKB_FAIL(-EPERM);
112 112
113 /* Eventually we might send routing messages too */ 113 /* Eventually we might send routing messages too */
diff --git a/net/decnet/sysctl_net_decnet.c b/net/decnet/sysctl_net_decnet.c
index bda5920215fd..e246f054f368 100644
--- a/net/decnet/sysctl_net_decnet.c
+++ b/net/decnet/sysctl_net_decnet.c
@@ -13,7 +13,6 @@
13 * Steve Whitehouse - Memory buffer settings, like the tcp ones 13 * Steve Whitehouse - Memory buffer settings, like the tcp ones
14 * 14 *
15 */ 15 */
16#include <linux/config.h>
17#include <linux/mm.h> 16#include <linux/mm.h>
18#include <linux/sysctl.h> 17#include <linux/sysctl.h>
19#include <linux/fs.h> 18#include <linux/fs.h>
diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c
index 868265619dbb..309ae4c6549a 100644
--- a/net/econet/af_econet.c
+++ b/net/econet/af_econet.c
@@ -9,7 +9,6 @@
9 * 9 *
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14 13
15#include <linux/types.h> 14#include <linux/types.h>
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index c971f14712ec..387c71c584ee 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -51,7 +51,6 @@
51#include <linux/etherdevice.h> 51#include <linux/etherdevice.h>
52#include <linux/skbuff.h> 52#include <linux/skbuff.h>
53#include <linux/errno.h> 53#include <linux/errno.h>
54#include <linux/config.h>
55#include <linux/init.h> 54#include <linux/init.h>
56#include <linux/if_ether.h> 55#include <linux/if_ether.h>
57#include <net/dst.h> 56#include <net/dst.h>
diff --git a/net/ieee80211/ieee80211_crypt_ccmp.c b/net/ieee80211/ieee80211_crypt_ccmp.c
index 78b2d13e80e3..492647382ad0 100644
--- a/net/ieee80211/ieee80211_crypt_ccmp.c
+++ b/net/ieee80211/ieee80211_crypt_ccmp.c
@@ -9,7 +9,6 @@
9 * more details. 9 * more details.
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/init.h> 13#include <linux/init.h>
15#include <linux/slab.h> 14#include <linux/slab.h>
diff --git a/net/ieee80211/ieee80211_crypt_tkip.c b/net/ieee80211/ieee80211_crypt_tkip.c
index 3fa5df2e1f0b..34dba0ba545d 100644
--- a/net/ieee80211/ieee80211_crypt_tkip.c
+++ b/net/ieee80211/ieee80211_crypt_tkip.c
@@ -9,7 +9,6 @@
9 * more details. 9 * more details.
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/init.h> 13#include <linux/init.h>
15#include <linux/slab.h> 14#include <linux/slab.h>
diff --git a/net/ieee80211/ieee80211_crypt_wep.c b/net/ieee80211/ieee80211_crypt_wep.c
index 649e581fa565..c5a87724aabe 100644
--- a/net/ieee80211/ieee80211_crypt_wep.c
+++ b/net/ieee80211/ieee80211_crypt_wep.c
@@ -9,7 +9,6 @@
9 * more details. 9 * more details.
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/init.h> 13#include <linux/init.h>
15#include <linux/slab.h> 14#include <linux/slab.h>
diff --git a/net/ieee80211/ieee80211_geo.c b/net/ieee80211/ieee80211_geo.c
index 192243ab35ed..305a09de85a5 100644
--- a/net/ieee80211/ieee80211_geo.c
+++ b/net/ieee80211/ieee80211_geo.c
@@ -24,7 +24,6 @@
24 24
25******************************************************************************/ 25******************************************************************************/
26#include <linux/compiler.h> 26#include <linux/compiler.h>
27#include <linux/config.h>
28#include <linux/errno.h> 27#include <linux/errno.h>
29#include <linux/if_arp.h> 28#include <linux/if_arp.h>
30#include <linux/in6.h> 29#include <linux/in6.h>
diff --git a/net/ieee80211/ieee80211_module.c b/net/ieee80211/ieee80211_module.c
index 2cb84d84f671..13b1e5fff7e4 100644
--- a/net/ieee80211/ieee80211_module.c
+++ b/net/ieee80211/ieee80211_module.c
@@ -31,7 +31,6 @@
31*******************************************************************************/ 31*******************************************************************************/
32 32
33#include <linux/compiler.h> 33#include <linux/compiler.h>
34#include <linux/config.h>
35#include <linux/errno.h> 34#include <linux/errno.h>
36#include <linux/if_arp.h> 35#include <linux/if_arp.h>
37#include <linux/in6.h> 36#include <linux/in6.h>
diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c
index 2bf567fd5a17..47ccf159372c 100644
--- a/net/ieee80211/ieee80211_rx.c
+++ b/net/ieee80211/ieee80211_rx.c
@@ -14,7 +14,6 @@
14 */ 14 */
15 15
16#include <linux/compiler.h> 16#include <linux/compiler.h>
17#include <linux/config.h>
18#include <linux/errno.h> 17#include <linux/errno.h>
19#include <linux/if_arp.h> 18#include <linux/if_arp.h>
20#include <linux/in6.h> 19#include <linux/in6.h>
diff --git a/net/ieee80211/ieee80211_tx.c b/net/ieee80211/ieee80211_tx.c
index 6a5de1b84459..de148ae594f3 100644
--- a/net/ieee80211/ieee80211_tx.c
+++ b/net/ieee80211/ieee80211_tx.c
@@ -24,7 +24,6 @@
24 24
25******************************************************************************/ 25******************************************************************************/
26#include <linux/compiler.h> 26#include <linux/compiler.h>
27#include <linux/config.h>
28#include <linux/errno.h> 27#include <linux/errno.h>
29#include <linux/if_arp.h> 28#include <linux/if_arp.h>
30#include <linux/in6.h> 29#include <linux/in6.h>
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 461216b47948..8d157157bf8e 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1097,7 +1097,7 @@ int inet_sk_rebuild_header(struct sock *sk)
1097 1097
1098EXPORT_SYMBOL(inet_sk_rebuild_header); 1098EXPORT_SYMBOL(inet_sk_rebuild_header);
1099 1099
1100static struct sk_buff *inet_gso_segment(struct sk_buff *skb, int sg) 1100static struct sk_buff *inet_gso_segment(struct sk_buff *skb, int features)
1101{ 1101{
1102 struct sk_buff *segs = ERR_PTR(-EINVAL); 1102 struct sk_buff *segs = ERR_PTR(-EINVAL);
1103 struct iphdr *iph; 1103 struct iphdr *iph;
@@ -1126,10 +1126,10 @@ static struct sk_buff *inet_gso_segment(struct sk_buff *skb, int sg)
1126 rcu_read_lock(); 1126 rcu_read_lock();
1127 ops = rcu_dereference(inet_protos[proto]); 1127 ops = rcu_dereference(inet_protos[proto]);
1128 if (ops && ops->gso_segment) 1128 if (ops && ops->gso_segment)
1129 segs = ops->gso_segment(skb, sg); 1129 segs = ops->gso_segment(skb, features);
1130 rcu_read_unlock(); 1130 rcu_read_unlock();
1131 1131
1132 if (IS_ERR(segs)) 1132 if (!segs || unlikely(IS_ERR(segs)))
1133 goto out; 1133 goto out;
1134 1134
1135 skb = segs; 1135 skb = segs;
diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c
index c7782230080d..8e748be36c5a 100644
--- a/net/ipv4/ah4.c
+++ b/net/ipv4/ah4.c
@@ -1,4 +1,3 @@
1#include <linux/config.h>
2#include <linux/module.h> 1#include <linux/module.h>
3#include <net/ip.h> 2#include <net/ip.h>
4#include <net/xfrm.h> 3#include <net/xfrm.h>
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 4749d504c629..7b51b3bdb548 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -80,7 +80,6 @@
80#include <linux/kernel.h> 80#include <linux/kernel.h>
81#include <linux/sched.h> 81#include <linux/sched.h>
82#include <linux/capability.h> 82#include <linux/capability.h>
83#include <linux/config.h>
84#include <linux/socket.h> 83#include <linux/socket.h>
85#include <linux/sockios.h> 84#include <linux/sockios.h>
86#include <linux/errno.h> 85#include <linux/errno.h>
diff --git a/net/ipv4/datagram.c b/net/ipv4/datagram.c
index c1b42b5257f8..ec5da4fbd9f4 100644
--- a/net/ipv4/datagram.c
+++ b/net/ipv4/datagram.c
@@ -11,7 +11,6 @@
11 * 2 of the License, or (at your option) any later version. 11 * 2 of the License, or (at your option) any later version.
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/types.h> 14#include <linux/types.h>
16#include <linux/module.h> 15#include <linux/module.h>
17#include <linux/ip.h> 16#include <linux/ip.h>
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 54419b27686f..a7c65e9e5ec9 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -27,7 +27,6 @@
27 * if no match found. 27 * if no match found.
28 */ 28 */
29 29
30#include <linux/config.h>
31 30
32#include <asm/uaccess.h> 31#include <asm/uaccess.h>
33#include <asm/system.h> 32#include <asm/system.h>
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c
index 9bbdd4494551..4e112738b3fa 100644
--- a/net/ipv4/esp4.c
+++ b/net/ipv4/esp4.c
@@ -1,4 +1,3 @@
1#include <linux/config.h>
2#include <linux/module.h> 1#include <linux/module.h>
3#include <net/ip.h> 2#include <net/ip.h>
4#include <net/xfrm.h> 3#include <net/xfrm.h>
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 31387abf53a2..ba2a70745a63 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -15,7 +15,6 @@
15 * 2 of the License, or (at your option) any later version. 15 * 2 of the License, or (at your option) any later version.
16 */ 16 */
17 17
18#include <linux/config.h>
19#include <linux/module.h> 18#include <linux/module.h>
20#include <asm/uaccess.h> 19#include <asm/uaccess.h>
21#include <asm/system.h> 20#include <asm/system.h>
diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c
index e2890ec8159e..3c1d32ad35f2 100644
--- a/net/ipv4/fib_hash.c
+++ b/net/ipv4/fib_hash.c
@@ -15,7 +15,6 @@
15 * 2 of the License, or (at your option) any later version. 15 * 2 of the License, or (at your option) any later version.
16 */ 16 */
17 17
18#include <linux/config.h>
19#include <asm/uaccess.h> 18#include <asm/uaccess.h>
20#include <asm/system.h> 19#include <asm/system.h>
21#include <linux/bitops.h> 20#include <linux/bitops.h>
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c
index ec566f3e66c7..6c642d11d4ca 100644
--- a/net/ipv4/fib_rules.c
+++ b/net/ipv4/fib_rules.c
@@ -19,7 +19,6 @@
19 * Marc Boucher : routing by fwmark 19 * Marc Boucher : routing by fwmark
20 */ 20 */
21 21
22#include <linux/config.h>
23#include <asm/uaccess.h> 22#include <asm/uaccess.h>
24#include <asm/system.h> 23#include <asm/system.h>
25#include <linux/bitops.h> 24#include <linux/bitops.h>
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 0f4145babb14..5f87533684d5 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -15,7 +15,6 @@
15 * 2 of the License, or (at your option) any later version. 15 * 2 of the License, or (at your option) any later version.
16 */ 16 */
17 17
18#include <linux/config.h>
19#include <asm/uaccess.h> 18#include <asm/uaccess.h>
20#include <asm/system.h> 19#include <asm/system.h>
21#include <linux/bitops.h> 20#include <linux/bitops.h>
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 95a639f2e3db..1cb65305e102 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -52,7 +52,6 @@
52 52
53#define VERSION "0.407" 53#define VERSION "0.407"
54 54
55#include <linux/config.h>
56#include <asm/uaccess.h> 55#include <asm/uaccess.h>
57#include <asm/system.h> 56#include <asm/system.h>
58#include <asm/bitops.h> 57#include <asm/bitops.h>
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 017900172f7d..4c86ac3d882d 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -64,7 +64,6 @@
64 * 64 *
65 */ 65 */
66 66
67#include <linux/config.h>
68#include <linux/module.h> 67#include <linux/module.h>
69#include <linux/types.h> 68#include <linux/types.h>
70#include <linux/jiffies.h> 69#include <linux/jiffies.h>
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index ab680c851aa2..d299c8e547d6 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -72,7 +72,6 @@
72 * Vinay Kulkarni 72 * Vinay Kulkarni
73 */ 73 */
74 74
75#include <linux/config.h>
76#include <linux/module.h> 75#include <linux/module.h>
77#include <asm/uaccess.h> 76#include <asm/uaccess.h>
78#include <asm/system.h> 77#include <asm/system.h>
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index 9a01bb81f8bf..e50a1bfd7ccc 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -13,7 +13,6 @@
13 * 2 of the License, or(at your option) any later version. 13 * 2 of the License, or(at your option) any later version.
14 */ 14 */
15 15
16#include <linux/config.h>
17#include <linux/module.h> 16#include <linux/module.h>
18#include <linux/jhash.h> 17#include <linux/jhash.h>
19 18
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index 457db99c76df..8e7e41b66c79 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -11,7 +11,6 @@
11 * 2 of the License, or (at your option) any later version. 11 * 2 of the License, or (at your option) any later version.
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/module.h> 14#include <linux/module.h>
16#include <linux/types.h> 15#include <linux/types.h>
17#include <linux/fcntl.h> 16#include <linux/fcntl.h>
diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c
index ee9b5515b9ae..95fac5532994 100644
--- a/net/ipv4/inet_hashtables.c
+++ b/net/ipv4/inet_hashtables.c
@@ -13,7 +13,6 @@
13 * 2 of the License, or (at your option) any later version. 13 * 2 of the License, or (at your option) any later version.
14 */ 14 */
15 15
16#include <linux/config.h>
17#include <linux/module.h> 16#include <linux/module.h>
18#include <linux/random.h> 17#include <linux/random.h>
19#include <linux/sched.h> 18#include <linux/sched.h>
diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c
index 417f126c749e..cdd805344c61 100644
--- a/net/ipv4/inet_timewait_sock.c
+++ b/net/ipv4/inet_timewait_sock.c
@@ -8,7 +8,6 @@
8 * From code orinally in TCP 8 * From code orinally in TCP
9 */ 9 */
10 10
11#include <linux/config.h>
12 11
13#include <net/inet_hashtables.h> 12#include <net/inet_hashtables.h>
14#include <net/inet_timewait_sock.h> 13#include <net/inet_timewait_sock.h>
diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c
index 9f0bb529ab70..a22d11d2911c 100644
--- a/net/ipv4/ip_forward.c
+++ b/net/ipv4/ip_forward.c
@@ -21,7 +21,6 @@
21 * Mike McLagan : Routing by source 21 * Mike McLagan : Routing by source
22 */ 22 */
23 23
24#include <linux/config.h>
25#include <linux/types.h> 24#include <linux/types.h>
26#include <linux/mm.h> 25#include <linux/mm.h>
27#include <linux/sched.h> 26#include <linux/sched.h>
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index da734c439179..b84b53a47526 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -23,7 +23,6 @@
23 */ 23 */
24 24
25#include <linux/compiler.h> 25#include <linux/compiler.h>
26#include <linux/config.h>
27#include <linux/module.h> 26#include <linux/module.h>
28#include <linux/types.h> 27#include <linux/types.h>
29#include <linux/mm.h> 28#include <linux/mm.h>
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index ab99bebdcdc8..6ff9b10d9563 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -11,7 +11,6 @@
11 */ 11 */
12 12
13#include <linux/capability.h> 13#include <linux/capability.h>
14#include <linux/config.h>
15#include <linux/module.h> 14#include <linux/module.h>
16#include <linux/types.h> 15#include <linux/types.h>
17#include <linux/sched.h> 16#include <linux/sched.h>
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c
index c9026dbf4c93..e1a7dba2fa8a 100644
--- a/net/ipv4/ip_input.c
+++ b/net/ipv4/ip_input.c
@@ -121,7 +121,6 @@
121#include <linux/kernel.h> 121#include <linux/kernel.h>
122#include <linux/string.h> 122#include <linux/string.h>
123#include <linux/errno.h> 123#include <linux/errno.h>
124#include <linux/config.h>
125 124
126#include <linux/net.h> 125#include <linux/net.h>
127#include <linux/socket.h> 126#include <linux/socket.h>
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 7624fd1d8f9f..ca0e714613fb 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -53,7 +53,6 @@
53#include <linux/mm.h> 53#include <linux/mm.h>
54#include <linux/string.h> 54#include <linux/string.h>
55#include <linux/errno.h> 55#include <linux/errno.h>
56#include <linux/config.h>
57 56
58#include <linux/socket.h> 57#include <linux/socket.h>
59#include <linux/sockios.h> 58#include <linux/sockios.h>
@@ -744,7 +743,7 @@ static inline int ip_ufo_append_data(struct sock *sk,
744 if (!err) { 743 if (!err) {
745 /* specify the length of each IP datagram fragment*/ 744 /* specify the length of each IP datagram fragment*/
746 skb_shinfo(skb)->gso_size = mtu - fragheaderlen; 745 skb_shinfo(skb)->gso_size = mtu - fragheaderlen;
747 skb_shinfo(skb)->gso_type = SKB_GSO_UDPV4; 746 skb_shinfo(skb)->gso_type = SKB_GSO_UDP;
748 __skb_queue_tail(&sk->sk_write_queue, skb); 747 __skb_queue_tail(&sk->sk_write_queue, skb);
749 748
750 return 0; 749 return 0;
@@ -1089,7 +1088,7 @@ ssize_t ip_append_page(struct sock *sk, struct page *page,
1089 if ((sk->sk_protocol == IPPROTO_UDP) && 1088 if ((sk->sk_protocol == IPPROTO_UDP) &&
1090 (rt->u.dst.dev->features & NETIF_F_UFO)) { 1089 (rt->u.dst.dev->features & NETIF_F_UFO)) {
1091 skb_shinfo(skb)->gso_size = mtu - fragheaderlen; 1090 skb_shinfo(skb)->gso_size = mtu - fragheaderlen;
1092 skb_shinfo(skb)->gso_type = SKB_GSO_UDPV4; 1091 skb_shinfo(skb)->gso_type = SKB_GSO_UDP;
1093 } 1092 }
1094 1093
1095 1094
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index 12e0bf19f24a..84f43a3c9098 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -17,7 +17,6 @@
17 * Mike McLagan : Routing by source 17 * Mike McLagan : Routing by source
18 */ 18 */
19 19
20#include <linux/config.h>
21#include <linux/module.h> 20#include <linux/module.h>
22#include <linux/types.h> 21#include <linux/types.h>
23#include <linux/mm.h> 22#include <linux/mm.h>
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c
index 3ed8b57a1002..8e0374847532 100644
--- a/net/ipv4/ipcomp.c
+++ b/net/ipv4/ipcomp.c
@@ -13,7 +13,6 @@
13 * - Compression stats. 13 * - Compression stats.
14 * - Adaptive compression. 14 * - Adaptive compression.
15 */ 15 */
16#include <linux/config.h>
17#include <linux/module.h> 16#include <linux/module.h>
18#include <asm/scatterlist.h> 17#include <asm/scatterlist.h>
19#include <asm/semaphore.h> 18#include <asm/semaphore.h>
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index ea398ee43f28..3291d5192aad 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -94,7 +94,6 @@
94 94
95 95
96#include <linux/capability.h> 96#include <linux/capability.h>
97#include <linux/config.h>
98#include <linux/module.h> 97#include <linux/module.h>
99#include <linux/types.h> 98#include <linux/types.h>
100#include <linux/sched.h> 99#include <linux/sched.h>
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 717ab7d6d7b6..ba33f8621c67 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -28,7 +28,6 @@
28 * 28 *
29 */ 29 */
30 30
31#include <linux/config.h>
32#include <asm/system.h> 31#include <asm/system.h>
33#include <asm/uaccess.h> 32#include <asm/uaccess.h>
34#include <linux/types.h> 33#include <linux/types.h>
diff --git a/net/ipv4/ipvs/ip_vs_est.c b/net/ipv4/ipvs/ip_vs_est.c
index c453e1e57f4b..4c1940381ba0 100644
--- a/net/ipv4/ipvs/ip_vs_est.c
+++ b/net/ipv4/ipvs/ip_vs_est.c
@@ -13,7 +13,6 @@
13 * Changes: 13 * Changes:
14 * 14 *
15 */ 15 */
16#include <linux/config.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <linux/jiffies.h> 17#include <linux/jiffies.h>
19#include <linux/slab.h> 18#include <linux/slab.h>
diff --git a/net/ipv4/multipath_drr.c b/net/ipv4/multipath_drr.c
index db67373f9b34..252e837b17a5 100644
--- a/net/ipv4/multipath_drr.c
+++ b/net/ipv4/multipath_drr.c
@@ -12,7 +12,6 @@
12 * 2 of the License, or (at your option) any later version. 12 * 2 of the License, or (at your option) any later version.
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <asm/system.h> 15#include <asm/system.h>
17#include <asm/uaccess.h> 16#include <asm/uaccess.h>
18#include <linux/types.h> 17#include <linux/types.h>
diff --git a/net/ipv4/multipath_random.c b/net/ipv4/multipath_random.c
index 5249dbe7c559..b8c289f247cb 100644
--- a/net/ipv4/multipath_random.c
+++ b/net/ipv4/multipath_random.c
@@ -12,7 +12,6 @@
12 * 2 of the License, or (at your option) any later version. 12 * 2 of the License, or (at your option) any later version.
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <asm/system.h> 15#include <asm/system.h>
17#include <asm/uaccess.h> 16#include <asm/uaccess.h>
18#include <linux/types.h> 17#include <linux/types.h>
diff --git a/net/ipv4/multipath_rr.c b/net/ipv4/multipath_rr.c
index b6cd2870478f..bba5abe5542d 100644
--- a/net/ipv4/multipath_rr.c
+++ b/net/ipv4/multipath_rr.c
@@ -12,7 +12,6 @@
12 * 2 of the License, or (at your option) any later version. 12 * 2 of the License, or (at your option) any later version.
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <asm/system.h> 15#include <asm/system.h>
17#include <asm/uaccess.h> 16#include <asm/uaccess.h>
18#include <linux/types.h> 17#include <linux/types.h>
diff --git a/net/ipv4/multipath_wrandom.c b/net/ipv4/multipath_wrandom.c
index 342d0b9098f5..d25ec4ae09e5 100644
--- a/net/ipv4/multipath_wrandom.c
+++ b/net/ipv4/multipath_wrandom.c
@@ -12,7 +12,6 @@
12 * 2 of the License, or (at your option) any later version. 12 * 2 of the License, or (at your option) any later version.
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <asm/system.h> 15#include <asm/system.h>
17#include <asm/uaccess.h> 16#include <asm/uaccess.h>
18#include <linux/types.h> 17#include <linux/types.h>
diff --git a/net/ipv4/netfilter/Kconfig b/net/ipv4/netfilter/Kconfig
index e1d7f5fbc526..ef0b5aac5838 100644
--- a/net/ipv4/netfilter/Kconfig
+++ b/net/ipv4/netfilter/Kconfig
@@ -332,7 +332,7 @@ config IP_NF_MATCH_HASHLIMIT
332 help 332 help
333 This option adds a new iptables `hashlimit' match. 333 This option adds a new iptables `hashlimit' match.
334 334
335 As opposed to `limit', this match dynamically crates a hash table 335 As opposed to `limit', this match dynamically creates a hash table
336 of limit buckets, based on your selection of source/destination 336 of limit buckets, based on your selection of source/destination
337 ip addresses and/or ports. 337 ip addresses and/or ports.
338 338
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c
index d0d19192026d..80c73ca90116 100644
--- a/net/ipv4/netfilter/arp_tables.c
+++ b/net/ipv4/netfilter/arp_tables.c
@@ -9,7 +9,6 @@
9 * 9 *
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/kernel.h> 12#include <linux/kernel.h>
14#include <linux/skbuff.h> 13#include <linux/skbuff.h>
15#include <linux/netdevice.h> 14#include <linux/netdevice.h>
@@ -1120,7 +1119,8 @@ int arpt_register_table(struct arpt_table *table,
1120 return ret; 1119 return ret;
1121 } 1120 }
1122 1121
1123 if (xt_register_table(table, &bootstrap, newinfo) != 0) { 1122 ret = xt_register_table(table, &bootstrap, newinfo);
1123 if (ret != 0) {
1124 xt_free_table_info(newinfo); 1124 xt_free_table_info(newinfo);
1125 return ret; 1125 return ret;
1126 } 1126 }
diff --git a/net/ipv4/netfilter/ip_conntrack_core.c b/net/ipv4/netfilter/ip_conntrack_core.c
index 7e4cf9a4d15f..aa459177c3f8 100644
--- a/net/ipv4/netfilter/ip_conntrack_core.c
+++ b/net/ipv4/netfilter/ip_conntrack_core.c
@@ -17,7 +17,6 @@
17 * - export ip_conntrack[_expect]_{find_get,put} functions 17 * - export ip_conntrack[_expect]_{find_get,put} functions
18 * */ 18 * */
19 19
20#include <linux/config.h>
21#include <linux/types.h> 20#include <linux/types.h>
22#include <linux/icmp.h> 21#include <linux/icmp.h>
23#include <linux/ip.h> 22#include <linux/ip.h>
diff --git a/net/ipv4/netfilter/ip_conntrack_ftp.c b/net/ipv4/netfilter/ip_conntrack_ftp.c
index 4dcf526c3944..1d18c863f064 100644
--- a/net/ipv4/netfilter/ip_conntrack_ftp.c
+++ b/net/ipv4/netfilter/ip_conntrack_ftp.c
@@ -8,7 +8,6 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/module.h> 11#include <linux/module.h>
13#include <linux/netfilter.h> 12#include <linux/netfilter.h>
14#include <linux/ip.h> 13#include <linux/ip.h>
diff --git a/net/ipv4/netfilter/ip_conntrack_helper_h323.c b/net/ipv4/netfilter/ip_conntrack_helper_h323.c
index 0665674218c6..af35235672d5 100644
--- a/net/ipv4/netfilter/ip_conntrack_helper_h323.c
+++ b/net/ipv4/netfilter/ip_conntrack_helper_h323.c
@@ -11,7 +11,6 @@
11 * For more information, please see http://nath323.sourceforge.net/ 11 * For more information, please see http://nath323.sourceforge.net/
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/module.h> 14#include <linux/module.h>
16#include <linux/netfilter.h> 15#include <linux/netfilter.h>
17#include <linux/ip.h> 16#include <linux/ip.h>
diff --git a/net/ipv4/netfilter/ip_conntrack_helper_pptp.c b/net/ipv4/netfilter/ip_conntrack_helper_pptp.c
index 8ccfe17bb253..b020a33e65e9 100644
--- a/net/ipv4/netfilter/ip_conntrack_helper_pptp.c
+++ b/net/ipv4/netfilter/ip_conntrack_helper_pptp.c
@@ -46,7 +46,6 @@
46 * 46 *
47 */ 47 */
48 48
49#include <linux/config.h>
50#include <linux/module.h> 49#include <linux/module.h>
51#include <linux/netfilter.h> 50#include <linux/netfilter.h>
52#include <linux/ip.h> 51#include <linux/ip.h>
diff --git a/net/ipv4/netfilter/ip_conntrack_irc.c b/net/ipv4/netfilter/ip_conntrack_irc.c
index a2ac5ce544b2..44889075f3b2 100644
--- a/net/ipv4/netfilter/ip_conntrack_irc.c
+++ b/net/ipv4/netfilter/ip_conntrack_irc.c
@@ -22,7 +22,6 @@
22 * 22 *
23 */ 23 */
24 24
25#include <linux/config.h>
26#include <linux/module.h> 25#include <linux/module.h>
27#include <linux/netfilter.h> 26#include <linux/netfilter.h>
28#include <linux/ip.h> 27#include <linux/ip.h>
diff --git a/net/ipv4/netfilter/ip_conntrack_proto_gre.c b/net/ipv4/netfilter/ip_conntrack_proto_gre.c
index 21ee124c0463..4ee016c427b4 100644
--- a/net/ipv4/netfilter/ip_conntrack_proto_gre.c
+++ b/net/ipv4/netfilter/ip_conntrack_proto_gre.c
@@ -23,7 +23,6 @@
23 * 23 *
24 */ 24 */
25 25
26#include <linux/config.h>
27#include <linux/module.h> 26#include <linux/module.h>
28#include <linux/types.h> 27#include <linux/types.h>
29#include <linux/timer.h> 28#include <linux/timer.h>
diff --git a/net/ipv4/netfilter/ip_conntrack_proto_sctp.c b/net/ipv4/netfilter/ip_conntrack_proto_sctp.c
index 0416073c5600..2d3612cd5f18 100644
--- a/net/ipv4/netfilter/ip_conntrack_proto_sctp.c
+++ b/net/ipv4/netfilter/ip_conntrack_proto_sctp.c
@@ -254,7 +254,7 @@ static int do_basic_checks(struct ip_conntrack *conntrack,
254 } 254 }
255 255
256 DEBUGP("Basic checks passed\n"); 256 DEBUGP("Basic checks passed\n");
257 return 0; 257 return count == 0;
258} 258}
259 259
260static int new_state(enum ip_conntrack_dir dir, 260static int new_state(enum ip_conntrack_dir dir,
diff --git a/net/ipv4/netfilter/ip_conntrack_proto_tcp.c b/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
index c5c2ce5cdeb8..fb920e76ec10 100644
--- a/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
+++ b/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
@@ -19,7 +19,6 @@
19 * version 2.2 19 * version 2.2
20 */ 20 */
21 21
22#include <linux/config.h>
23#include <linux/types.h> 22#include <linux/types.h>
24#include <linux/sched.h> 23#include <linux/sched.h>
25#include <linux/timer.h> 24#include <linux/timer.h>
diff --git a/net/ipv4/netfilter/ip_conntrack_standalone.c b/net/ipv4/netfilter/ip_conntrack_standalone.c
index 88445aac3f28..7bd3c22003a2 100644
--- a/net/ipv4/netfilter/ip_conntrack_standalone.c
+++ b/net/ipv4/netfilter/ip_conntrack_standalone.c
@@ -12,7 +12,6 @@
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/types.h> 15#include <linux/types.h>
17#include <linux/ip.h> 16#include <linux/ip.h>
18#include <linux/netfilter.h> 17#include <linux/netfilter.h>
diff --git a/net/ipv4/netfilter/ip_nat_helper.c b/net/ipv4/netfilter/ip_nat_helper.c
index 5d506e0564d5..cbcaa45370ae 100644
--- a/net/ipv4/netfilter/ip_nat_helper.c
+++ b/net/ipv4/netfilter/ip_nat_helper.c
@@ -15,7 +15,6 @@
15 * - make ip_nat_resize_packet more generic (TCP and UDP) 15 * - make ip_nat_resize_packet more generic (TCP and UDP)
16 * - add ip_nat_mangle_udp_packet 16 * - add ip_nat_mangle_udp_packet
17 */ 17 */
18#include <linux/config.h>
19#include <linux/module.h> 18#include <linux/module.h>
20#include <linux/kmod.h> 19#include <linux/kmod.h>
21#include <linux/types.h> 20#include <linux/types.h>
diff --git a/net/ipv4/netfilter/ip_nat_helper_pptp.c b/net/ipv4/netfilter/ip_nat_helper_pptp.c
index f3977726ff09..1d149964dc38 100644
--- a/net/ipv4/netfilter/ip_nat_helper_pptp.c
+++ b/net/ipv4/netfilter/ip_nat_helper_pptp.c
@@ -35,7 +35,6 @@
35 * 35 *
36 */ 36 */
37 37
38#include <linux/config.h>
39#include <linux/module.h> 38#include <linux/module.h>
40#include <linux/ip.h> 39#include <linux/ip.h>
41#include <linux/tcp.h> 40#include <linux/tcp.h>
diff --git a/net/ipv4/netfilter/ip_nat_proto_gre.c b/net/ipv4/netfilter/ip_nat_proto_gre.c
index 96ceabaec402..38acfdf540eb 100644
--- a/net/ipv4/netfilter/ip_nat_proto_gre.c
+++ b/net/ipv4/netfilter/ip_nat_proto_gre.c
@@ -23,7 +23,6 @@
23 * 23 *
24 */ 24 */
25 25
26#include <linux/config.h>
27#include <linux/module.h> 26#include <linux/module.h>
28#include <linux/ip.h> 27#include <linux/ip.h>
29#include <linux/netfilter_ipv4/ip_nat.h> 28#include <linux/netfilter_ipv4/ip_nat.h>
diff --git a/net/ipv4/netfilter/ip_nat_snmp_basic.c b/net/ipv4/netfilter/ip_nat_snmp_basic.c
index d20d557f915a..0b1b416759cc 100644
--- a/net/ipv4/netfilter/ip_nat_snmp_basic.c
+++ b/net/ipv4/netfilter/ip_nat_snmp_basic.c
@@ -43,7 +43,6 @@
43 * 2000-08-06: Convert to new helper API (Harald Welte). 43 * 2000-08-06: Convert to new helper API (Harald Welte).
44 * 44 *
45 */ 45 */
46#include <linux/config.h>
47#include <linux/in.h> 46#include <linux/in.h>
48#include <linux/module.h> 47#include <linux/module.h>
49#include <linux/types.h> 48#include <linux/types.h>
diff --git a/net/ipv4/netfilter/ip_nat_standalone.c b/net/ipv4/netfilter/ip_nat_standalone.c
index 67e676783da9..17de077a7901 100644
--- a/net/ipv4/netfilter/ip_nat_standalone.c
+++ b/net/ipv4/netfilter/ip_nat_standalone.c
@@ -18,7 +18,6 @@
18 * - now capable of multiple expectations for one master 18 * - now capable of multiple expectations for one master
19 * */ 19 * */
20 20
21#include <linux/config.h>
22#include <linux/types.h> 21#include <linux/types.h>
23#include <linux/icmp.h> 22#include <linux/icmp.h>
24#include <linux/ip.h> 23#include <linux/ip.h>
diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c
index b93f0494362f..198ac36db861 100644
--- a/net/ipv4/netfilter/ip_queue.c
+++ b/net/ipv4/netfilter/ip_queue.c
@@ -457,11 +457,19 @@ dev_cmp(struct ipq_queue_entry *entry, unsigned long ifindex)
457 if (entry->info->indev) 457 if (entry->info->indev)
458 if (entry->info->indev->ifindex == ifindex) 458 if (entry->info->indev->ifindex == ifindex)
459 return 1; 459 return 1;
460
461 if (entry->info->outdev) 460 if (entry->info->outdev)
462 if (entry->info->outdev->ifindex == ifindex) 461 if (entry->info->outdev->ifindex == ifindex)
463 return 1; 462 return 1;
464 463#ifdef CONFIG_BRIDGE_NETFILTER
464 if (entry->skb->nf_bridge) {
465 if (entry->skb->nf_bridge->physindev &&
466 entry->skb->nf_bridge->physindev->ifindex == ifindex)
467 return 1;
468 if (entry->skb->nf_bridge->physoutdev &&
469 entry->skb->nf_bridge->physoutdev->ifindex == ifindex)
470 return 1;
471 }
472#endif
465 return 0; 473 return 0;
466} 474}
467 475
@@ -507,7 +515,7 @@ ipq_rcv_skb(struct sk_buff *skb)
507 if (type <= IPQM_BASE) 515 if (type <= IPQM_BASE)
508 return; 516 return;
509 517
510 if (security_netlink_recv(skb)) 518 if (security_netlink_recv(skb, CAP_NET_ADMIN))
511 RCV_SKB_FAIL(-EPERM); 519 RCV_SKB_FAIL(-EPERM);
512 520
513 write_lock_bh(&queue_lock); 521 write_lock_bh(&queue_lock);
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
index 706c0025ec5e..fc5bdd5eb7d3 100644
--- a/net/ipv4/netfilter/ip_tables.c
+++ b/net/ipv4/netfilter/ip_tables.c
@@ -14,7 +14,6 @@
14 * 08 Oct 2005 Harald Welte <lafore@netfilter.org> 14 * 08 Oct 2005 Harald Welte <lafore@netfilter.org>
15 * - Generalize into "x_tables" layer and "{ip,ip6,arp}_tables" 15 * - Generalize into "x_tables" layer and "{ip,ip6,arp}_tables"
16 */ 16 */
17#include <linux/config.h>
18#include <linux/cache.h> 17#include <linux/cache.h>
19#include <linux/capability.h> 18#include <linux/capability.h>
20#include <linux/skbuff.h> 19#include <linux/skbuff.h>
@@ -2113,7 +2112,8 @@ int ipt_register_table(struct xt_table *table, const struct ipt_replace *repl)
2113 return ret; 2112 return ret;
2114 } 2113 }
2115 2114
2116 if (xt_register_table(table, &bootstrap, newinfo) != 0) { 2115 ret = xt_register_table(table, &bootstrap, newinfo);
2116 if (ret != 0) {
2117 xt_free_table_info(newinfo); 2117 xt_free_table_info(newinfo);
2118 return ret; 2118 return ret;
2119 } 2119 }
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c
index dbc83c5d7aa6..cbffeae3f565 100644
--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
+++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
@@ -10,7 +10,6 @@
10 * 10 *
11 */ 11 */
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/config.h>
14#include <linux/proc_fs.h> 13#include <linux/proc_fs.h>
15#include <linux/jhash.h> 14#include <linux/jhash.h>
16#include <linux/bitops.h> 15#include <linux/bitops.h>
diff --git a/net/ipv4/netfilter/ipt_MASQUERADE.c b/net/ipv4/netfilter/ipt_MASQUERADE.c
index 8b3e7f99b861..ebd94f2abf0d 100644
--- a/net/ipv4/netfilter/ipt_MASQUERADE.c
+++ b/net/ipv4/netfilter/ipt_MASQUERADE.c
@@ -9,7 +9,6 @@
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/types.h> 12#include <linux/types.h>
14#include <linux/inetdevice.h> 13#include <linux/inetdevice.h>
15#include <linux/ip.h> 14#include <linux/ip.h>
diff --git a/net/ipv4/netfilter/ipt_NETMAP.c b/net/ipv4/netfilter/ipt_NETMAP.c
index 2fcf1075b027..736c4b5a86a7 100644
--- a/net/ipv4/netfilter/ipt_NETMAP.c
+++ b/net/ipv4/netfilter/ipt_NETMAP.c
@@ -10,7 +10,6 @@
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/ip.h> 13#include <linux/ip.h>
15#include <linux/module.h> 14#include <linux/module.h>
16#include <linux/netdevice.h> 15#include <linux/netdevice.h>
diff --git a/net/ipv4/netfilter/ipt_REJECT.c b/net/ipv4/netfilter/ipt_REJECT.c
index 431a3ce6f7b7..269bc2067cb8 100644
--- a/net/ipv4/netfilter/ipt_REJECT.c
+++ b/net/ipv4/netfilter/ipt_REJECT.c
@@ -12,7 +12,6 @@
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/module.h> 15#include <linux/module.h>
17#include <linux/skbuff.h> 16#include <linux/skbuff.h>
18#include <linux/ip.h> 17#include <linux/ip.h>
diff --git a/net/ipv4/netfilter/ipt_ULOG.c b/net/ipv4/netfilter/ipt_ULOG.c
index c84cc03389d8..d7dd7fe7051c 100644
--- a/net/ipv4/netfilter/ipt_ULOG.c
+++ b/net/ipv4/netfilter/ipt_ULOG.c
@@ -47,7 +47,6 @@
47 */ 47 */
48 48
49#include <linux/module.h> 49#include <linux/module.h>
50#include <linux/config.h>
51#include <linux/spinlock.h> 50#include <linux/spinlock.h>
52#include <linux/socket.h> 51#include <linux/socket.h>
53#include <linux/skbuff.h> 52#include <linux/skbuff.h>
diff --git a/net/ipv4/netfilter/iptable_mangle.c b/net/ipv4/netfilter/iptable_mangle.c
index 397b95cc026b..4e7998beda63 100644
--- a/net/ipv4/netfilter/iptable_mangle.c
+++ b/net/ipv4/netfilter/iptable_mangle.c
@@ -10,7 +10,6 @@
10 * 10 *
11 * Extended to all five netfilter hooks by Brad Chapman & Harald Welte 11 * Extended to all five netfilter hooks by Brad Chapman & Harald Welte
12 */ 12 */
13#include <linux/config.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <linux/netfilter_ipv4/ip_tables.h> 14#include <linux/netfilter_ipv4/ip_tables.h>
16#include <linux/netdevice.h> 15#include <linux/netdevice.h>
diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
index 8cc8e1b36778..0af803df82b0 100644
--- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
+++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
@@ -14,7 +14,6 @@
14 * Derived from net/ipv4/netfilter/ip_conntrack_standalone.c 14 * Derived from net/ipv4/netfilter/ip_conntrack_standalone.c
15 */ 15 */
16 16
17#include <linux/config.h>
18#include <linux/types.h> 17#include <linux/types.h>
19#include <linux/ip.h> 18#include <linux/ip.h>
20#include <linux/netfilter.h> 19#include <linux/netfilter.h>
diff --git a/net/ipv4/protocol.c b/net/ipv4/protocol.c
index 291831e792af..05f5114828ea 100644
--- a/net/ipv4/protocol.c
+++ b/net/ipv4/protocol.c
@@ -32,7 +32,6 @@
32#include <linux/kernel.h> 32#include <linux/kernel.h>
33#include <linux/sched.h> 33#include <linux/sched.h>
34#include <linux/string.h> 34#include <linux/string.h>
35#include <linux/config.h>
36#include <linux/socket.h> 35#include <linux/socket.h>
37#include <linux/in.h> 36#include <linux/in.h>
38#include <linux/inet.h> 37#include <linux/inet.h>
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 60b11aece5c3..da44fabf4dc5 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -64,7 +64,6 @@
64 * 2 of the License, or (at your option) any later version. 64 * 2 of the License, or (at your option) any later version.
65 */ 65 */
66 66
67#include <linux/config.h>
68#include <linux/module.h> 67#include <linux/module.h>
69#include <asm/uaccess.h> 68#include <asm/uaccess.h>
70#include <asm/system.h> 69#include <asm/system.h>
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index ce4cd5f35511..70cea9d08a38 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -10,7 +10,6 @@
10#include <linux/mm.h> 10#include <linux/mm.h>
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/sysctl.h> 12#include <linux/sysctl.h>
13#include <linux/config.h>
14#include <linux/igmp.h> 13#include <linux/igmp.h>
15#include <linux/inetdevice.h> 14#include <linux/inetdevice.h>
16#include <net/snmp.h> 15#include <net/snmp.h>
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index c04176be7ed1..804458712d88 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -247,7 +247,6 @@
247 * TCP_CLOSE socket is finished 247 * TCP_CLOSE socket is finished
248 */ 248 */
249 249
250#include <linux/config.h>
251#include <linux/module.h> 250#include <linux/module.h>
252#include <linux/types.h> 251#include <linux/types.h>
253#include <linux/fcntl.h> 252#include <linux/fcntl.h>
@@ -643,7 +642,7 @@ static inline int select_size(struct sock *sk, struct tcp_sock *tp)
643 int tmp = tp->mss_cache; 642 int tmp = tp->mss_cache;
644 643
645 if (sk->sk_route_caps & NETIF_F_SG) { 644 if (sk->sk_route_caps & NETIF_F_SG) {
646 if (sk->sk_route_caps & NETIF_F_TSO) 645 if (sk_can_gso(sk))
647 tmp = 0; 646 tmp = 0;
648 else { 647 else {
649 int pgbreak = SKB_MAX_HEAD(MAX_TCP_HEADER); 648 int pgbreak = SKB_MAX_HEAD(MAX_TCP_HEADER);
@@ -2145,7 +2144,7 @@ int compat_tcp_getsockopt(struct sock *sk, int level, int optname,
2145EXPORT_SYMBOL(compat_tcp_getsockopt); 2144EXPORT_SYMBOL(compat_tcp_getsockopt);
2146#endif 2145#endif
2147 2146
2148struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int sg) 2147struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features)
2149{ 2148{
2150 struct sk_buff *segs = ERR_PTR(-EINVAL); 2149 struct sk_buff *segs = ERR_PTR(-EINVAL);
2151 struct tcphdr *th; 2150 struct tcphdr *th;
@@ -2169,7 +2168,17 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int sg)
2169 oldlen = (u16)~skb->len; 2168 oldlen = (u16)~skb->len;
2170 __skb_pull(skb, thlen); 2169 __skb_pull(skb, thlen);
2171 2170
2172 segs = skb_segment(skb, sg); 2171 if (skb_gso_ok(skb, features | NETIF_F_GSO_ROBUST)) {
2172 /* Packet is from an untrusted source, reset gso_segs. */
2173 int mss = skb_shinfo(skb)->gso_size;
2174
2175 skb_shinfo(skb)->gso_segs = (skb->len + mss - 1) / mss;
2176
2177 segs = NULL;
2178 goto out;
2179 }
2180
2181 segs = skb_segment(skb, features);
2173 if (IS_ERR(segs)) 2182 if (IS_ERR(segs))
2174 goto out; 2183 goto out;
2175 2184
@@ -2205,6 +2214,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int sg)
2205out: 2214out:
2206 return segs; 2215 return segs;
2207} 2216}
2217EXPORT_SYMBOL(tcp_tso_segment);
2208 2218
2209extern void __skb_cb_too_small_for_tcp(int, int); 2219extern void __skb_cb_too_small_for_tcp(int, int);
2210extern struct tcp_congestion_ops tcp_reno; 2220extern struct tcp_congestion_ops tcp_reno;
diff --git a/net/ipv4/tcp_bic.c b/net/ipv4/tcp_bic.c
index b2d9021ad22b..b0134ab08379 100644
--- a/net/ipv4/tcp_bic.c
+++ b/net/ipv4/tcp_bic.c
@@ -12,7 +12,6 @@
12 * this behaves the same as the original Reno. 12 * this behaves the same as the original Reno.
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/mm.h> 15#include <linux/mm.h>
17#include <linux/module.h> 16#include <linux/module.h>
18#include <net/tcp.h> 17#include <net/tcp.h>
diff --git a/net/ipv4/tcp_cong.c b/net/ipv4/tcp_cong.c
index 857eefc52aab..5765f9d03174 100644
--- a/net/ipv4/tcp_cong.c
+++ b/net/ipv4/tcp_cong.c
@@ -6,7 +6,6 @@
6 * Copyright (C) 2005 Stephen Hemminger <shemminger@osdl.org> 6 * Copyright (C) 2005 Stephen Hemminger <shemminger@osdl.org>
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/module.h> 9#include <linux/module.h>
11#include <linux/mm.h> 10#include <linux/mm.h>
12#include <linux/types.h> 11#include <linux/types.h>
diff --git a/net/ipv4/tcp_cubic.c b/net/ipv4/tcp_cubic.c
index 78b7a6b9e4de..2be27980ca78 100644
--- a/net/ipv4/tcp_cubic.c
+++ b/net/ipv4/tcp_cubic.c
@@ -12,7 +12,6 @@
12 * this behaves the same as the original Reno. 12 * this behaves the same as the original Reno.
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/mm.h> 15#include <linux/mm.h>
17#include <linux/module.h> 16#include <linux/module.h>
18#include <net/tcp.h> 17#include <net/tcp.h>
diff --git a/net/ipv4/tcp_diag.c b/net/ipv4/tcp_diag.c
index c148c1081880..57c5f0b10e6c 100644
--- a/net/ipv4/tcp_diag.c
+++ b/net/ipv4/tcp_diag.c
@@ -11,7 +11,6 @@
11 * 2 of the License, or (at your option) any later version. 11 * 2 of the License, or (at your option) any later version.
12 */ 12 */
13 13
14#include <linux/config.h>
15 14
16#include <linux/module.h> 15#include <linux/module.h>
17#include <linux/inet_diag.h> 16#include <linux/inet_diag.h>
@@ -26,7 +25,10 @@ static void tcp_diag_get_info(struct sock *sk, struct inet_diag_msg *r,
26 const struct tcp_sock *tp = tcp_sk(sk); 25 const struct tcp_sock *tp = tcp_sk(sk);
27 struct tcp_info *info = _info; 26 struct tcp_info *info = _info;
28 27
29 r->idiag_rqueue = tp->rcv_nxt - tp->copied_seq; 28 if (sk->sk_state == TCP_LISTEN)
29 r->idiag_rqueue = sk->sk_ack_backlog;
30 else
31 r->idiag_rqueue = tp->rcv_nxt - tp->copied_seq;
30 r->idiag_wqueue = tp->write_seq - tp->snd_una; 32 r->idiag_wqueue = tp->write_seq - tp->snd_una;
31 if (info != NULL) 33 if (info != NULL)
32 tcp_get_info(sk, info); 34 tcp_get_info(sk, info);
diff --git a/net/ipv4/tcp_highspeed.c b/net/ipv4/tcp_highspeed.c
index 1120245b2373..aaa1538c0692 100644
--- a/net/ipv4/tcp_highspeed.c
+++ b/net/ipv4/tcp_highspeed.c
@@ -6,7 +6,6 @@
6 * John Heffner <jheffner@psc.edu> 6 * John Heffner <jheffner@psc.edu>
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/module.h> 9#include <linux/module.h>
11#include <net/tcp.h> 10#include <net/tcp.h>
12 11
diff --git a/net/ipv4/tcp_htcp.c b/net/ipv4/tcp_htcp.c
index 3d92c1859267..6edfe5e4510e 100644
--- a/net/ipv4/tcp_htcp.c
+++ b/net/ipv4/tcp_htcp.c
@@ -6,7 +6,6 @@
6 * http://www.hamilton.ie/net/htcp3.pdf 6 * http://www.hamilton.ie/net/htcp3.pdf
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/mm.h> 9#include <linux/mm.h>
11#include <linux/module.h> 10#include <linux/module.h>
12#include <net/tcp.h> 11#include <net/tcp.h>
diff --git a/net/ipv4/tcp_hybla.c b/net/ipv4/tcp_hybla.c
index 40dbb3877510..7406e0c5fb8e 100644
--- a/net/ipv4/tcp_hybla.c
+++ b/net/ipv4/tcp_hybla.c
@@ -10,7 +10,6 @@
10 * root at danielinux.net 10 * root at danielinux.net
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <net/tcp.h> 14#include <net/tcp.h>
16 15
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 94fe5b1f9dcb..738dad9f7d49 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -63,7 +63,6 @@
63 * Pasi Sarolahti: F-RTO for dealing with spurious RTOs 63 * Pasi Sarolahti: F-RTO for dealing with spurious RTOs
64 */ 64 */
65 65
66#include <linux/config.h>
67#include <linux/mm.h> 66#include <linux/mm.h>
68#include <linux/module.h> 67#include <linux/module.h>
69#include <linux/sysctl.h> 68#include <linux/sysctl.h>
@@ -4178,8 +4177,6 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb,
4178 */ 4177 */
4179 4178
4180 TCP_ECN_rcv_synack(tp, th); 4179 TCP_ECN_rcv_synack(tp, th);
4181 if (tp->ecn_flags&TCP_ECN_OK)
4182 sock_set_flag(sk, SOCK_NO_LARGESEND);
4183 4180
4184 tp->snd_wl1 = TCP_SKB_CB(skb)->seq; 4181 tp->snd_wl1 = TCP_SKB_CB(skb)->seq;
4185 tcp_ack(sk, skb, FLAG_SLOWPATH); 4182 tcp_ack(sk, skb, FLAG_SLOWPATH);
@@ -4322,8 +4319,6 @@ discard:
4322 tp->max_window = tp->snd_wnd; 4319 tp->max_window = tp->snd_wnd;
4323 4320
4324 TCP_ECN_rcv_syn(tp, th); 4321 TCP_ECN_rcv_syn(tp, th);
4325 if (tp->ecn_flags&TCP_ECN_OK)
4326 sock_set_flag(sk, SOCK_NO_LARGESEND);
4327 4322
4328 tcp_mtup_init(sk); 4323 tcp_mtup_init(sk);
4329 tcp_sync_mss(sk, icsk->icsk_pmtu_cookie); 4324 tcp_sync_mss(sk, icsk->icsk_pmtu_cookie);
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 25ecc6e2478b..8355b729fa95 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -52,7 +52,6 @@
52 * a single port at the same time. 52 * a single port at the same time.
53 */ 53 */
54 54
55#include <linux/config.h>
56 55
57#include <linux/types.h> 56#include <linux/types.h>
58#include <linux/fcntl.h> 57#include <linux/fcntl.h>
@@ -242,6 +241,7 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
242 goto failure; 241 goto failure;
243 242
244 /* OK, now commit destination to socket. */ 243 /* OK, now commit destination to socket. */
244 sk->sk_gso_type = SKB_GSO_TCPV4;
245 sk_setup_caps(sk, &rt->u.dst); 245 sk_setup_caps(sk, &rt->u.dst);
246 246
247 if (!tp->write_seq) 247 if (!tp->write_seq)
@@ -884,6 +884,7 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
884 if (!newsk) 884 if (!newsk)
885 goto exit; 885 goto exit;
886 886
887 newsk->sk_gso_type = SKB_GSO_TCPV4;
887 sk_setup_caps(newsk, dst); 888 sk_setup_caps(newsk, dst);
888 889
889 newtp = tcp_sk(newsk); 890 newtp = tcp_sk(newsk);
@@ -1726,7 +1727,8 @@ static void get_tcp4_sock(struct sock *sp, char *tmpbuf, int i)
1726 sprintf(tmpbuf, "%4d: %08X:%04X %08X:%04X %02X %08X:%08X %02X:%08lX " 1727 sprintf(tmpbuf, "%4d: %08X:%04X %08X:%04X %02X %08X:%08X %02X:%08lX "
1727 "%08X %5d %8d %lu %d %p %u %u %u %u %d", 1728 "%08X %5d %8d %lu %d %p %u %u %u %u %d",
1728 i, src, srcp, dest, destp, sp->sk_state, 1729 i, src, srcp, dest, destp, sp->sk_state,
1729 tp->write_seq - tp->snd_una, tp->rcv_nxt - tp->copied_seq, 1730 tp->write_seq - tp->snd_una,
1731 (sp->sk_state == TCP_LISTEN) ? sp->sk_ack_backlog : (tp->rcv_nxt - tp->copied_seq),
1730 timer_active, 1732 timer_active,
1731 jiffies_to_clock_t(timer_expires - jiffies), 1733 jiffies_to_clock_t(timer_expires - jiffies),
1732 icsk->icsk_retransmits, 1734 icsk->icsk_retransmits,
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index 2b9b7f6c7f7c..e0851697ad5e 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -20,7 +20,6 @@
20 * Jorge Cwik, <jorge@laser.satlink.net> 20 * Jorge Cwik, <jorge@laser.satlink.net>
21 */ 21 */
22 22
23#include <linux/config.h>
24#include <linux/mm.h> 23#include <linux/mm.h>
25#include <linux/module.h> 24#include <linux/module.h>
26#include <linux/sysctl.h> 25#include <linux/sysctl.h>
@@ -440,8 +439,6 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct request_sock *req,
440 newicsk->icsk_ack.last_seg_size = skb->len - newtp->tcp_header_len; 439 newicsk->icsk_ack.last_seg_size = skb->len - newtp->tcp_header_len;
441 newtp->rx_opt.mss_clamp = req->mss; 440 newtp->rx_opt.mss_clamp = req->mss;
442 TCP_ECN_openreq_child(newtp, req); 441 TCP_ECN_openreq_child(newtp, req);
443 if (newtp->ecn_flags&TCP_ECN_OK)
444 sock_set_flag(newsk, SOCK_NO_LARGESEND);
445 442
446 TCP_INC_STATS_BH(TCP_MIB_PASSIVEOPENS); 443 TCP_INC_STATS_BH(TCP_MIB_PASSIVEOPENS);
447 } 444 }
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index bdd71db8bf90..5c08ea20a18d 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -510,8 +510,7 @@ static void tcp_queue_skb(struct sock *sk, struct sk_buff *skb)
510 510
511static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb, unsigned int mss_now) 511static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb, unsigned int mss_now)
512{ 512{
513 if (skb->len <= mss_now || 513 if (skb->len <= mss_now || !sk_can_gso(sk)) {
514 !(sk->sk_route_caps & NETIF_F_TSO)) {
515 /* Avoid the costly divide in the normal 514 /* Avoid the costly divide in the normal
516 * non-TSO case. 515 * non-TSO case.
517 */ 516 */
@@ -525,7 +524,7 @@ static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb, unsigned
525 factor /= mss_now; 524 factor /= mss_now;
526 skb_shinfo(skb)->gso_segs = factor; 525 skb_shinfo(skb)->gso_segs = factor;
527 skb_shinfo(skb)->gso_size = mss_now; 526 skb_shinfo(skb)->gso_size = mss_now;
528 skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4; 527 skb_shinfo(skb)->gso_type = sk->sk_gso_type;
529 } 528 }
530} 529}
531 530
@@ -824,9 +823,7 @@ unsigned int tcp_current_mss(struct sock *sk, int large_allowed)
824 823
825 mss_now = tp->mss_cache; 824 mss_now = tp->mss_cache;
826 825
827 if (large_allowed && 826 if (large_allowed && sk_can_gso(sk) && !tp->urg_mode)
828 (sk->sk_route_caps & NETIF_F_TSO) &&
829 !tp->urg_mode)
830 doing_tso = 1; 827 doing_tso = 1;
831 828
832 if (dst) { 829 if (dst) {
@@ -2044,8 +2041,6 @@ struct sk_buff * tcp_make_synack(struct sock *sk, struct dst_entry *dst,
2044 memset(th, 0, sizeof(struct tcphdr)); 2041 memset(th, 0, sizeof(struct tcphdr));
2045 th->syn = 1; 2042 th->syn = 1;
2046 th->ack = 1; 2043 th->ack = 1;
2047 if (dst->dev->features&NETIF_F_TSO)
2048 ireq->ecn_ok = 0;
2049 TCP_ECN_make_synack(req, th); 2044 TCP_ECN_make_synack(req, th);
2050 th->source = inet_sk(sk)->sport; 2045 th->source = inet_sk(sk)->sport;
2051 th->dest = ireq->rmt_port; 2046 th->dest = ireq->rmt_port;
diff --git a/net/ipv4/tcp_scalable.c b/net/ipv4/tcp_scalable.c
index 26d7486ee501..4624501e9680 100644
--- a/net/ipv4/tcp_scalable.c
+++ b/net/ipv4/tcp_scalable.c
@@ -5,7 +5,6 @@
5 * John Heffner <jheffner@sc.edu> 5 * John Heffner <jheffner@sc.edu>
6 */ 6 */
7 7
8#include <linux/config.h>
9#include <linux/module.h> 8#include <linux/module.h>
10#include <net/tcp.h> 9#include <net/tcp.h>
11 10
diff --git a/net/ipv4/tcp_vegas.c b/net/ipv4/tcp_vegas.c
index 3b7403495052..490360b5b4bf 100644
--- a/net/ipv4/tcp_vegas.c
+++ b/net/ipv4/tcp_vegas.c
@@ -31,7 +31,6 @@
31 * assumed senders never went idle. 31 * assumed senders never went idle.
32 */ 32 */
33 33
34#include <linux/config.h>
35#include <linux/mm.h> 34#include <linux/mm.h>
36#include <linux/module.h> 35#include <linux/module.h>
37#include <linux/skbuff.h> 36#include <linux/skbuff.h>
diff --git a/net/ipv4/tcp_westwood.c b/net/ipv4/tcp_westwood.c
index 4247da1384bf..5446312ffd2a 100644
--- a/net/ipv4/tcp_westwood.c
+++ b/net/ipv4/tcp_westwood.c
@@ -21,7 +21,6 @@
21 * ssthresh after packet loss. The probing phase is as the original Reno. 21 * ssthresh after packet loss. The probing phase is as the original Reno.
22 */ 22 */
23 23
24#include <linux/config.h>
25#include <linux/mm.h> 24#include <linux/mm.h>
26#include <linux/module.h> 25#include <linux/module.h>
27#include <linux/skbuff.h> 26#include <linux/skbuff.h>
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 3f93292b0ad8..9bfcddad695b 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -91,7 +91,6 @@
91#include <linux/errno.h> 91#include <linux/errno.h>
92#include <linux/timer.h> 92#include <linux/timer.h>
93#include <linux/mm.h> 93#include <linux/mm.h>
94#include <linux/config.h>
95#include <linux/inet.h> 94#include <linux/inet.h>
96#include <linux/ipv6.h> 95#include <linux/ipv6.h>
97#include <linux/netdevice.h> 96#include <linux/netdevice.h>
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c
index c0465284dfac..8f50eae47d03 100644
--- a/net/ipv4/xfrm4_policy.c
+++ b/net/ipv4/xfrm4_policy.c
@@ -9,7 +9,6 @@
9 */ 9 */
10 10
11#include <linux/compiler.h> 11#include <linux/compiler.h>
12#include <linux/config.h>
13#include <linux/inetdevice.h> 12#include <linux/inetdevice.h>
14#include <net/xfrm.h> 13#include <net/xfrm.h>
15#include <net/ip.h> 14#include <net/ip.h>
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 4da664538f52..c250d0af10d7 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -40,7 +40,6 @@
40 * status etc. 40 * status etc.
41 */ 41 */
42 42
43#include <linux/config.h>
44#include <linux/errno.h> 43#include <linux/errno.h>
45#include <linux/types.h> 44#include <linux/types.h>
46#include <linux/socket.h> 45#include <linux/socket.h>
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index e19457fe4f6e..5a0ba58b86cc 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -23,7 +23,6 @@
23 23
24#include <linux/module.h> 24#include <linux/module.h>
25#include <linux/capability.h> 25#include <linux/capability.h>
26#include <linux/config.h>
27#include <linux/errno.h> 26#include <linux/errno.h>
28#include <linux/types.h> 27#include <linux/types.h>
29#include <linux/socket.h> 28#include <linux/socket.h>
@@ -660,8 +659,6 @@ int inet6_sk_rebuild_header(struct sock *sk)
660 } 659 }
661 660
662 ip6_dst_store(sk, dst, NULL); 661 ip6_dst_store(sk, dst, NULL);
663 sk->sk_route_caps = dst->dev->features &
664 ~(NETIF_F_IP_CSUM | NETIF_F_TSO);
665 } 662 }
666 663
667 return 0; 664 return 0;
diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c
index d31c0d6c0448..9d4831bd4335 100644
--- a/net/ipv6/ah6.c
+++ b/net/ipv6/ah6.c
@@ -24,7 +24,6 @@
24 * This file is derived from net/ipv4/ah.c. 24 * This file is derived from net/ipv4/ah.c.
25 */ 25 */
26 26
27#include <linux/config.h>
28#include <linux/module.h> 27#include <linux/module.h>
29#include <net/ip.h> 28#include <net/ip.h>
30#include <net/ah.h> 29#include <net/ah.h>
diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c
index 39ec528923f6..f6881d7a0385 100644
--- a/net/ipv6/anycast.c
+++ b/net/ipv6/anycast.c
@@ -14,7 +14,6 @@
14 */ 14 */
15 15
16#include <linux/capability.h> 16#include <linux/capability.h>
17#include <linux/config.h>
18#include <linux/module.h> 17#include <linux/module.h>
19#include <linux/errno.h> 18#include <linux/errno.h>
20#include <linux/types.h> 19#include <linux/types.h>
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index a15a6f320f70..a278d5e862fe 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -24,7 +24,6 @@
24 * This file is derived from net/ipv4/esp.c 24 * This file is derived from net/ipv4/esp.c
25 */ 25 */
26 26
27#include <linux/config.h>
28#include <linux/module.h> 27#include <linux/module.h>
29#include <net/ip.h> 28#include <net/ip.h>
30#include <net/xfrm.h> 29#include <net/xfrm.h>
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
index a18d4256372c..9d0ee7f0eeb5 100644
--- a/net/ipv6/exthdrs.c
+++ b/net/ipv6/exthdrs.c
@@ -179,7 +179,7 @@ static int ipv6_destopt_rcv(struct sk_buff **skbp)
179 179
180static struct inet6_protocol destopt_protocol = { 180static struct inet6_protocol destopt_protocol = {
181 .handler = ipv6_destopt_rcv, 181 .handler = ipv6_destopt_rcv,
182 .flags = INET6_PROTO_NOPOLICY, 182 .flags = INET6_PROTO_NOPOLICY | INET6_PROTO_GSO_EXTHDR,
183}; 183};
184 184
185void __init ipv6_destopt_init(void) 185void __init ipv6_destopt_init(void)
@@ -340,7 +340,7 @@ looped_back:
340 340
341static struct inet6_protocol rthdr_protocol = { 341static struct inet6_protocol rthdr_protocol = {
342 .handler = ipv6_rthdr_rcv, 342 .handler = ipv6_rthdr_rcv,
343 .flags = INET6_PROTO_NOPOLICY, 343 .flags = INET6_PROTO_NOPOLICY | INET6_PROTO_GSO_EXTHDR,
344}; 344};
345 345
346void __init ipv6_rthdr_init(void) 346void __init ipv6_rthdr_init(void)
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c
index eb2865d5ae28..5c950cc79d80 100644
--- a/net/ipv6/inet6_connection_sock.c
+++ b/net/ipv6/inet6_connection_sock.c
@@ -13,7 +13,6 @@
13 * 2 of the License, or(at your option) any later version. 13 * 2 of the License, or(at your option) any later version.
14 */ 14 */
15 15
16#include <linux/config.h>
17#include <linux/module.h> 16#include <linux/module.h>
18#include <linux/in6.h> 17#include <linux/in6.h>
19#include <linux/ipv6.h> 18#include <linux/ipv6.h>
@@ -187,8 +186,6 @@ int inet6_csk_xmit(struct sk_buff *skb, int ipfragok)
187 } 186 }
188 187
189 ip6_dst_store(sk, dst, NULL); 188 ip6_dst_store(sk, dst, NULL);
190 sk->sk_route_caps = dst->dev->features &
191 ~(NETIF_F_IP_CSUM | NETIF_F_TSO);
192 } 189 }
193 190
194 skb->dst = dst_clone(dst); 191 skb->dst = dst_clone(dst);
diff --git a/net/ipv6/inet6_hashtables.c b/net/ipv6/inet6_hashtables.c
index 2ae84c961678..d2f3fc990bfa 100644
--- a/net/ipv6/inet6_hashtables.c
+++ b/net/ipv6/inet6_hashtables.c
@@ -14,7 +14,6 @@
14 * 2 of the License, or (at your option) any later version. 14 * 2 of the License, or (at your option) any later version.
15 */ 15 */
16 16
17#include <linux/config.h>
18#include <linux/module.h> 17#include <linux/module.h>
19#include <linux/random.h> 18#include <linux/random.h>
20 19
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 2cb6149349bf..764221220afd 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -19,7 +19,6 @@
19 * remove ip6_null_entry from the top of 19 * remove ip6_null_entry from the top of
20 * routing table. 20 * routing table.
21 */ 21 */
22#include <linux/config.h>
23#include <linux/errno.h> 22#include <linux/errno.h>
24#include <linux/types.h> 23#include <linux/types.h>
25#include <linux/net.h> 24#include <linux/net.h>
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
index f9ca63912fbf..1d672b0547f2 100644
--- a/net/ipv6/ip6_flowlabel.c
+++ b/net/ipv6/ip6_flowlabel.c
@@ -10,7 +10,6 @@
10 */ 10 */
11 11
12#include <linux/capability.h> 12#include <linux/capability.h>
13#include <linux/config.h>
14#include <linux/errno.h> 13#include <linux/errno.h>
15#include <linux/types.h> 14#include <linux/types.h>
16#include <linux/socket.h> 15#include <linux/socket.h>
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
index aceee252503d..df8f051c0fce 100644
--- a/net/ipv6/ip6_input.c
+++ b/net/ipv6/ip6_input.c
@@ -84,14 +84,9 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
84 */ 84 */
85 IP6CB(skb)->iif = skb->dst ? ((struct rt6_info *)skb->dst)->rt6i_idev->dev->ifindex : dev->ifindex; 85 IP6CB(skb)->iif = skb->dst ? ((struct rt6_info *)skb->dst)->rt6i_idev->dev->ifindex : dev->ifindex;
86 86
87 if (skb->len < sizeof(struct ipv6hdr)) 87 if (unlikely(!pskb_may_pull(skb, sizeof(*hdr))))
88 goto err; 88 goto err;
89 89
90 if (!pskb_may_pull(skb, sizeof(struct ipv6hdr))) {
91 IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
92 goto drop;
93 }
94
95 hdr = skb->nh.ipv6h; 90 hdr = skb->nh.ipv6h;
96 91
97 if (hdr->version != 6) 92 if (hdr->version != 6)
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index abb94de33768..2c5b44575af0 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -28,7 +28,6 @@
28 * for datagram xmit 28 * for datagram xmit
29 */ 29 */
30 30
31#include <linux/config.h>
32#include <linux/errno.h> 31#include <linux/errno.h>
33#include <linux/types.h> 32#include <linux/types.h>
34#include <linux/string.h> 33#include <linux/string.h>
@@ -230,7 +229,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
230 skb->priority = sk->sk_priority; 229 skb->priority = sk->sk_priority;
231 230
232 mtu = dst_mtu(dst); 231 mtu = dst_mtu(dst);
233 if ((skb->len <= mtu) || ipfragok) { 232 if ((skb->len <= mtu) || ipfragok || skb_shinfo(skb)->gso_size) {
234 IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS); 233 IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
235 return NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, 234 return NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev,
236 dst_output); 235 dst_output);
@@ -835,7 +834,7 @@ static inline int ip6_ufo_append_data(struct sock *sk,
835 /* specify the length of each IP datagram fragment*/ 834 /* specify the length of each IP datagram fragment*/
836 skb_shinfo(skb)->gso_size = mtu - fragheaderlen - 835 skb_shinfo(skb)->gso_size = mtu - fragheaderlen -
837 sizeof(struct frag_hdr); 836 sizeof(struct frag_hdr);
838 skb_shinfo(skb)->gso_type = SKB_GSO_UDPV4; 837 skb_shinfo(skb)->gso_type = SKB_GSO_UDP;
839 ipv6_select_ident(skb, &fhdr); 838 ipv6_select_ident(skb, &fhdr);
840 skb_shinfo(skb)->ip6_frag_id = fhdr.identification; 839 skb_shinfo(skb)->ip6_frag_id = fhdr.identification;
841 __skb_queue_tail(&sk->sk_write_queue, skb); 840 __skb_queue_tail(&sk->sk_write_queue, skb);
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index a995796b5a57..bc77c0e1a943 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -19,7 +19,6 @@
19 * 19 *
20 */ 20 */
21 21
22#include <linux/config.h>
23#include <linux/module.h> 22#include <linux/module.h>
24#include <linux/capability.h> 23#include <linux/capability.h>
25#include <linux/errno.h> 24#include <linux/errno.h>
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c
index f28cd37feed3..b285b0357084 100644
--- a/net/ipv6/ipcomp6.c
+++ b/net/ipv6/ipcomp6.c
@@ -30,7 +30,6 @@
30 * The decompression of IP datagram MUST be done after the reassembly, 30 * The decompression of IP datagram MUST be done after the reassembly,
31 * AH/ESP processing. 31 * AH/ESP processing.
32 */ 32 */
33#include <linux/config.h>
34#include <linux/module.h> 33#include <linux/module.h>
35#include <net/ip.h> 34#include <net/ip.h>
36#include <net/xfrm.h> 35#include <net/xfrm.h>
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 4c20eeb3d568..c28e5c287447 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -27,7 +27,6 @@
27 27
28#include <linux/module.h> 28#include <linux/module.h>
29#include <linux/capability.h> 29#include <linux/capability.h>
30#include <linux/config.h>
31#include <linux/errno.h> 30#include <linux/errno.h>
32#include <linux/types.h> 31#include <linux/types.h>
33#include <linux/socket.h> 32#include <linux/socket.h>
@@ -58,9 +57,71 @@
58 57
59DEFINE_SNMP_STAT(struct ipstats_mib, ipv6_statistics) __read_mostly; 58DEFINE_SNMP_STAT(struct ipstats_mib, ipv6_statistics) __read_mostly;
60 59
60static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb, int features)
61{
62 struct sk_buff *segs = ERR_PTR(-EINVAL);
63 struct ipv6hdr *ipv6h;
64 struct inet6_protocol *ops;
65 int proto;
66
67 if (unlikely(!pskb_may_pull(skb, sizeof(*ipv6h))))
68 goto out;
69
70 ipv6h = skb->nh.ipv6h;
71 proto = ipv6h->nexthdr;
72 __skb_pull(skb, sizeof(*ipv6h));
73
74 rcu_read_lock();
75 for (;;) {
76 struct ipv6_opt_hdr *opth;
77 int len;
78
79 if (proto != NEXTHDR_HOP) {
80 ops = rcu_dereference(inet6_protos[proto]);
81
82 if (unlikely(!ops))
83 goto unlock;
84
85 if (!(ops->flags & INET6_PROTO_GSO_EXTHDR))
86 break;
87 }
88
89 if (unlikely(!pskb_may_pull(skb, 8)))
90 goto unlock;
91
92 opth = (void *)skb->data;
93 len = opth->hdrlen * 8 + 8;
94
95 if (unlikely(!pskb_may_pull(skb, len)))
96 goto unlock;
97
98 proto = opth->nexthdr;
99 __skb_pull(skb, len);
100 }
101
102 skb->h.raw = skb->data;
103 if (likely(ops->gso_segment))
104 segs = ops->gso_segment(skb, features);
105
106unlock:
107 rcu_read_unlock();
108
109 if (unlikely(IS_ERR(segs)))
110 goto out;
111
112 for (skb = segs; skb; skb = skb->next) {
113 ipv6h = skb->nh.ipv6h;
114 ipv6h->payload_len = htons(skb->len - skb->mac_len);
115 }
116
117out:
118 return segs;
119}
120
61static struct packet_type ipv6_packet_type = { 121static struct packet_type ipv6_packet_type = {
62 .type = __constant_htons(ETH_P_IPV6), 122 .type = __constant_htons(ETH_P_IPV6),
63 .func = ipv6_rcv, 123 .func = ipv6_rcv,
124 .gso_segment = ipv6_gso_segment,
64}; 125};
65 126
66struct ip6_ra_chain *ip6_ra_chain; 127struct ip6_ra_chain *ip6_ra_chain;
diff --git a/net/ipv6/ipv6_syms.c b/net/ipv6/ipv6_syms.c
index 16482785bdfd..dd4d1ce77769 100644
--- a/net/ipv6/ipv6_syms.c
+++ b/net/ipv6/ipv6_syms.c
@@ -1,5 +1,4 @@
1 1
2#include <linux/config.h>
3#include <linux/module.h> 2#include <linux/module.h>
4#include <net/protocol.h> 3#include <net/protocol.h>
5#include <net/ipv6.h> 4#include <net/ipv6.h>
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 6e871afbb2c7..9d697d4dcffc 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -28,7 +28,6 @@
28 * - MLDv2 support 28 * - MLDv2 support
29 */ 29 */
30 30
31#include <linux/config.h>
32#include <linux/module.h> 31#include <linux/module.h>
33#include <linux/errno.h> 32#include <linux/errno.h>
34#include <linux/types.h> 33#include <linux/types.h>
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index dfa20d3be9b6..b50055b9278d 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -48,7 +48,6 @@
48#endif 48#endif
49 49
50#include <linux/module.h> 50#include <linux/module.h>
51#include <linux/config.h>
52#include <linux/errno.h> 51#include <linux/errno.h>
53#include <linux/types.h> 52#include <linux/types.h>
54#include <linux/socket.h> 53#include <linux/socket.h>
diff --git a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c
index b4b7d441af25..968a14be0d05 100644
--- a/net/ipv6/netfilter/ip6_queue.c
+++ b/net/ipv6/netfilter/ip6_queue.c
@@ -505,7 +505,7 @@ ipq_rcv_skb(struct sk_buff *skb)
505 if (type <= IPQM_BASE) 505 if (type <= IPQM_BASE)
506 return; 506 return;
507 507
508 if (security_netlink_recv(skb)) 508 if (security_netlink_recv(skb, CAP_NET_ADMIN))
509 RCV_SKB_FAIL(-EPERM); 509 RCV_SKB_FAIL(-EPERM);
510 510
511 write_lock_bh(&queue_lock); 511 write_lock_bh(&queue_lock);
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index 2e72f89a7019..7ef143c0ebf6 100644
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -19,7 +19,6 @@
19 */ 19 */
20 20
21#include <linux/capability.h> 21#include <linux/capability.h>
22#include <linux/config.h>
23#include <linux/in.h> 22#include <linux/in.h>
24#include <linux/skbuff.h> 23#include <linux/skbuff.h>
25#include <linux/kmod.h> 24#include <linux/kmod.h>
@@ -1281,7 +1280,8 @@ int ip6t_register_table(struct xt_table *table,
1281 return ret; 1280 return ret;
1282 } 1281 }
1283 1282
1284 if (xt_register_table(table, &bootstrap, newinfo) != 0) { 1283 ret = xt_register_table(table, &bootstrap, newinfo);
1284 if (ret != 0) {
1285 xt_free_table_info(newinfo); 1285 xt_free_table_info(newinfo);
1286 return ret; 1286 return ret;
1287 } 1287 }
diff --git a/net/ipv6/netfilter/ip6t_REJECT.c b/net/ipv6/netfilter/ip6t_REJECT.c
index de1175c27f6d..8629ba195d2d 100644
--- a/net/ipv6/netfilter/ip6t_REJECT.c
+++ b/net/ipv6/netfilter/ip6t_REJECT.c
@@ -15,7 +15,6 @@
15 * 2 of the License, or (at your option) any later version. 15 * 2 of the License, or (at your option) any later version.
16 */ 16 */
17 17
18#include <linux/config.h>
19#include <linux/module.h> 18#include <linux/module.h>
20#include <linux/skbuff.h> 19#include <linux/skbuff.h>
21#include <linux/icmpv6.h> 20#include <linux/icmpv6.h>
diff --git a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
index 2a71c3b669f1..c2ab38ff46af 100644
--- a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
+++ b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
@@ -20,7 +20,6 @@
20 * structures. 20 * structures.
21 */ 21 */
22 22
23#include <linux/config.h>
24#include <linux/types.h> 23#include <linux/types.h>
25#include <linux/ipv6.h> 24#include <linux/ipv6.h>
26#include <linux/in6.h> 25#include <linux/in6.h>
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index c32a029e43f0..00d5583807f7 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -14,7 +14,6 @@
14 * 2 of the License, or (at your option) any later version. 14 * 2 of the License, or (at your option) any later version.
15 */ 15 */
16 16
17#include <linux/config.h>
18#include <linux/errno.h> 17#include <linux/errno.h>
19#include <linux/types.h> 18#include <linux/types.h>
20#include <linux/string.h> 19#include <linux/string.h>
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index 779ddf77f4d4..efee7a6301a8 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/config.h>
21#include <linux/sched.h> 20#include <linux/sched.h>
22#include <linux/socket.h> 21#include <linux/socket.h>
23#include <linux/net.h> 22#include <linux/net.h>
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index eef985e010ea..4e299c69e1c6 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -28,7 +28,6 @@
28 * YOSHIFUJI,H. @USAGI Always remove fragment header to 28 * YOSHIFUJI,H. @USAGI Always remove fragment header to
29 * calculate ICV correctly. 29 * calculate ICV correctly.
30 */ 30 */
31#include <linux/config.h>
32#include <linux/errno.h> 31#include <linux/errno.h>
33#include <linux/types.h> 32#include <linux/types.h>
34#include <linux/string.h> 33#include <linux/string.h>
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index e728980160d2..87c39c978cd0 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -25,7 +25,6 @@
25 */ 25 */
26 26
27#include <linux/capability.h> 27#include <linux/capability.h>
28#include <linux/config.h>
29#include <linux/errno.h> 28#include <linux/errno.h>
30#include <linux/types.h> 29#include <linux/types.h>
31#include <linux/times.h> 30#include <linux/times.h>
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 6578c3080f47..c56aeece2bf5 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -18,7 +18,6 @@
18 * Nate Thompson <nate@thebog.net>: 6to4 support 18 * Nate Thompson <nate@thebog.net>: 6to4 support
19 */ 19 */
20 20
21#include <linux/config.h>
22#include <linux/module.h> 21#include <linux/module.h>
23#include <linux/capability.h> 22#include <linux/capability.h>
24#include <linux/errno.h> 23#include <linux/errno.h>
diff --git a/net/ipv6/sysctl_net_ipv6.c b/net/ipv6/sysctl_net_ipv6.c
index 8eff9fa1e983..7a4639db1346 100644
--- a/net/ipv6/sysctl_net_ipv6.c
+++ b/net/ipv6/sysctl_net_ipv6.c
@@ -7,7 +7,6 @@
7 7
8#include <linux/mm.h> 8#include <linux/mm.h>
9#include <linux/sysctl.h> 9#include <linux/sysctl.h>
10#include <linux/config.h>
11#include <linux/in6.h> 10#include <linux/in6.h>
12#include <linux/ipv6.h> 11#include <linux/ipv6.h>
13#include <net/ndisc.h> 12#include <net/ndisc.h>
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index a50eb306e9e2..5bdcb9002cf7 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -26,7 +26,6 @@
26 */ 26 */
27 27
28#include <linux/module.h> 28#include <linux/module.h>
29#include <linux/config.h>
30#include <linux/errno.h> 29#include <linux/errno.h>
31#include <linux/types.h> 30#include <linux/types.h>
32#include <linux/socket.h> 31#include <linux/socket.h>
@@ -270,9 +269,8 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
270 ipv6_addr_copy(&np->saddr, saddr); 269 ipv6_addr_copy(&np->saddr, saddr);
271 inet->rcv_saddr = LOOPBACK4_IPV6; 270 inet->rcv_saddr = LOOPBACK4_IPV6;
272 271
272 sk->sk_gso_type = SKB_GSO_TCPV6;
273 ip6_dst_store(sk, dst, NULL); 273 ip6_dst_store(sk, dst, NULL);
274 sk->sk_route_caps = dst->dev->features &
275 ~(NETIF_F_IP_CSUM | NETIF_F_TSO);
276 274
277 icsk->icsk_ext_hdr_len = 0; 275 icsk->icsk_ext_hdr_len = 0;
278 if (np->opt) 276 if (np->opt)
@@ -930,9 +928,8 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
930 * comment in that function for the gory details. -acme 928 * comment in that function for the gory details. -acme
931 */ 929 */
932 930
931 sk->sk_gso_type = SKB_GSO_TCPV6;
933 ip6_dst_store(newsk, dst, NULL); 932 ip6_dst_store(newsk, dst, NULL);
934 newsk->sk_route_caps = dst->dev->features &
935 ~(NETIF_F_IP_CSUM | NETIF_F_TSO);
936 933
937 newtcp6sk = (struct tcp6_sock *)newsk; 934 newtcp6sk = (struct tcp6_sock *)newsk;
938 inet_sk(newsk)->pinet6 = &newtcp6sk->inet6; 935 inet_sk(newsk)->pinet6 = &newtcp6sk->inet6;
@@ -1469,7 +1466,8 @@ static void get_tcp6_sock(struct seq_file *seq, struct sock *sp, int i)
1469 dest->s6_addr32[0], dest->s6_addr32[1], 1466 dest->s6_addr32[0], dest->s6_addr32[1],
1470 dest->s6_addr32[2], dest->s6_addr32[3], destp, 1467 dest->s6_addr32[2], dest->s6_addr32[3], destp,
1471 sp->sk_state, 1468 sp->sk_state,
1472 tp->write_seq-tp->snd_una, tp->rcv_nxt-tp->copied_seq, 1469 tp->write_seq-tp->snd_una,
1470 (sp->sk_state == TCP_LISTEN) ? sp->sk_ack_backlog : (tp->rcv_nxt - tp->copied_seq),
1473 timer_active, 1471 timer_active,
1474 jiffies_to_clock_t(timer_expires - jiffies), 1472 jiffies_to_clock_t(timer_expires - jiffies),
1475 icsk->icsk_retransmits, 1473 icsk->icsk_retransmits,
@@ -1605,6 +1603,7 @@ struct proto tcpv6_prot = {
1605static struct inet6_protocol tcpv6_protocol = { 1603static struct inet6_protocol tcpv6_protocol = {
1606 .handler = tcp_v6_rcv, 1604 .handler = tcp_v6_rcv,
1607 .err_handler = tcp_v6_err, 1605 .err_handler = tcp_v6_err,
1606 .gso_segment = tcp_tso_segment,
1608 .flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL, 1607 .flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL,
1609}; 1608};
1610 1609
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 8d3432a70f3a..ccc57f434cd3 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -23,7 +23,6 @@
23 * 2 of the License, or (at your option) any later version. 23 * 2 of the License, or (at your option) any later version.
24 */ 24 */
25 25
26#include <linux/config.h>
27#include <linux/errno.h> 26#include <linux/errno.h>
28#include <linux/types.h> 27#include <linux/types.h>
29#include <linux/socket.h> 28#include <linux/socket.h>
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
index ee715f2691e9..73cd250aecbb 100644
--- a/net/ipv6/xfrm6_policy.c
+++ b/net/ipv6/xfrm6_policy.c
@@ -12,7 +12,6 @@
12 */ 12 */
13 13
14#include <linux/compiler.h> 14#include <linux/compiler.h>
15#include <linux/config.h>
16#include <linux/netdevice.h> 15#include <linux/netdevice.h>
17#include <net/addrconf.h> 16#include <net/addrconf.h>
18#include <net/xfrm.h> 17#include <net/xfrm.h>
diff --git a/net/ipv6/xfrm6_tunnel.c b/net/ipv6/xfrm6_tunnel.c
index d37768e5064f..6b44fe8516c3 100644
--- a/net/ipv6/xfrm6_tunnel.c
+++ b/net/ipv6/xfrm6_tunnel.c
@@ -21,7 +21,6 @@
21 * Based on net/ipv4/xfrm4_tunnel.c 21 * Based on net/ipv4/xfrm4_tunnel.c
22 * 22 *
23 */ 23 */
24#include <linux/config.h>
25#include <linux/module.h> 24#include <linux/module.h>
26#include <linux/xfrm.h> 25#include <linux/xfrm.h>
27#include <linux/list.h> 26#include <linux/list.h>
diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c
index 811d998725bc..aa34ff4b707c 100644
--- a/net/ipx/af_ipx.c
+++ b/net/ipx/af_ipx.c
@@ -28,7 +28,6 @@
28 * See net/ipx/ChangeLog. 28 * See net/ipx/ChangeLog.
29 */ 29 */
30 30
31#include <linux/config.h>
32#include <linux/capability.h> 31#include <linux/capability.h>
33#include <linux/errno.h> 32#include <linux/errno.h>
34#include <linux/if_arp.h> 33#include <linux/if_arp.h>
diff --git a/net/ipx/ipx_proc.c b/net/ipx/ipx_proc.c
index 1f73d9ea434d..4c0c71206e54 100644
--- a/net/ipx/ipx_proc.c
+++ b/net/ipx/ipx_proc.c
@@ -4,7 +4,6 @@
4 * Copyright(C) Arnaldo Carvalho de Melo <acme@conectiva.com.br>, 2002 4 * Copyright(C) Arnaldo Carvalho de Melo <acme@conectiva.com.br>, 2002
5 */ 5 */
6 6
7#include <linux/config.h>
8#include <linux/init.h> 7#include <linux/init.h>
9#ifdef CONFIG_PROC_FS 8#ifdef CONFIG_PROC_FS
10#include <linux/proc_fs.h> 9#include <linux/proc_fs.h>
diff --git a/net/ipx/ipx_route.c b/net/ipx/ipx_route.c
index bba3431cd9a5..a30dbb1e08fb 100644
--- a/net/ipx/ipx_route.c
+++ b/net/ipx/ipx_route.c
@@ -7,7 +7,6 @@
7 * See net/ipx/ChangeLog. 7 * See net/ipx/ChangeLog.
8 */ 8 */
9 9
10#include <linux/config.h>
11#include <linux/list.h> 10#include <linux/list.h>
12#include <linux/route.h> 11#include <linux/route.h>
13#include <linux/spinlock.h> 12#include <linux/spinlock.h>
diff --git a/net/ipx/sysctl_net_ipx.c b/net/ipx/sysctl_net_ipx.c
index 510eda96d10a..fa574735c76f 100644
--- a/net/ipx/sysctl_net_ipx.c
+++ b/net/ipx/sysctl_net_ipx.c
@@ -6,7 +6,6 @@
6 * Added /proc/sys/net/ipx/ipx_pprop_broadcasting - acme March 4, 2001 6 * Added /proc/sys/net/ipx/ipx_pprop_broadcasting - acme March 4, 2001
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/mm.h> 9#include <linux/mm.h>
11#include <linux/sysctl.h> 10#include <linux/sysctl.h>
12 11
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c
index 2f37c9f35e27..7fae48a53bff 100644
--- a/net/irda/af_irda.c
+++ b/net/irda/af_irda.c
@@ -42,7 +42,6 @@
42 * 42 *
43 ********************************************************************/ 43 ********************************************************************/
44 44
45#include <linux/config.h>
46#include <linux/capability.h> 45#include <linux/capability.h>
47#include <linux/module.h> 46#include <linux/module.h>
48#include <linux/types.h> 47#include <linux/types.h>
diff --git a/net/irda/ircomm/ircomm_core.c b/net/irda/ircomm/ircomm_core.c
index 286881978858..9c4a902a9dba 100644
--- a/net/irda/ircomm/ircomm_core.c
+++ b/net/irda/ircomm/ircomm_core.c
@@ -29,7 +29,6 @@
29 * 29 *
30 ********************************************************************/ 30 ********************************************************************/
31 31
32#include <linux/config.h>
33#include <linux/module.h> 32#include <linux/module.h>
34#include <linux/sched.h> 33#include <linux/sched.h>
35#include <linux/proc_fs.h> 34#include <linux/proc_fs.h>
diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c
index b592c4bc3331..b400f27851fc 100644
--- a/net/irda/ircomm/ircomm_tty.c
+++ b/net/irda/ircomm/ircomm_tty.c
@@ -30,7 +30,6 @@
30 * 30 *
31 ********************************************************************/ 31 ********************************************************************/
32 32
33#include <linux/config.h>
34#include <linux/init.h> 33#include <linux/init.h>
35#include <linux/module.h> 34#include <linux/module.h>
36#include <linux/fs.h> 35#include <linux/fs.h>
diff --git a/net/irda/irda_device.c b/net/irda/irda_device.c
index e3debbdb67f5..ba40e5495f58 100644
--- a/net/irda/irda_device.c
+++ b/net/irda/irda_device.c
@@ -29,7 +29,6 @@
29 * 29 *
30 ********************************************************************/ 30 ********************************************************************/
31 31
32#include <linux/config.h>
33#include <linux/string.h> 32#include <linux/string.h>
34#include <linux/proc_fs.h> 33#include <linux/proc_fs.h>
35#include <linux/skbuff.h> 34#include <linux/skbuff.h>
diff --git a/net/irda/iriap.c b/net/irda/iriap.c
index 2d2e2b1919f4..a0472652a44e 100644
--- a/net/irda/iriap.c
+++ b/net/irda/iriap.c
@@ -24,7 +24,6 @@
24 * 24 *
25 ********************************************************************/ 25 ********************************************************************/
26 26
27#include <linux/config.h>
28#include <linux/module.h> 27#include <linux/module.h>
29#include <linux/types.h> 28#include <linux/types.h>
30#include <linux/skbuff.h> 29#include <linux/skbuff.h>
diff --git a/net/irda/irlan/irlan_client.c b/net/irda/irlan/irlan_client.c
index f8e6cb0db04b..95cf1234ea17 100644
--- a/net/irda/irlan/irlan_client.c
+++ b/net/irda/irlan/irlan_client.c
@@ -173,13 +173,14 @@ void irlan_client_discovery_indication(discinfo_t *discovery,
173 rcu_read_lock(); 173 rcu_read_lock();
174 self = irlan_get_any(); 174 self = irlan_get_any();
175 if (self) { 175 if (self) {
176 IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); 176 IRDA_ASSERT(self->magic == IRLAN_MAGIC, goto out;);
177 177
178 IRDA_DEBUG(1, "%s(), Found instance (%08x)!\n", __FUNCTION__ , 178 IRDA_DEBUG(1, "%s(), Found instance (%08x)!\n", __FUNCTION__ ,
179 daddr); 179 daddr);
180 180
181 irlan_client_wakeup(self, saddr, daddr); 181 irlan_client_wakeup(self, saddr, daddr);
182 } 182 }
183IRDA_ASSERT_LABEL(out:)
183 rcu_read_unlock(); 184 rcu_read_unlock();
184} 185}
185 186
diff --git a/net/irda/irlan/irlan_common.c b/net/irda/irlan/irlan_common.c
index 657d12210578..bd659dd545ac 100644
--- a/net/irda/irlan/irlan_common.c
+++ b/net/irda/irlan/irlan_common.c
@@ -23,7 +23,6 @@
23 * 23 *
24 ********************************************************************/ 24 ********************************************************************/
25 25
26#include <linux/config.h>
27#include <linux/module.h> 26#include <linux/module.h>
28 27
29#include <linux/kernel.h> 28#include <linux/kernel.h>
diff --git a/net/irda/irlan/irlan_eth.c b/net/irda/irlan/irlan_eth.c
index 953e255d2bc8..b0ccc455b747 100644
--- a/net/irda/irlan/irlan_eth.c
+++ b/net/irda/irlan/irlan_eth.c
@@ -25,7 +25,6 @@
25 * 25 *
26 ********************************************************************/ 26 ********************************************************************/
27 27
28#include <linux/config.h>
29#include <linux/netdevice.h> 28#include <linux/netdevice.h>
30#include <linux/etherdevice.h> 29#include <linux/etherdevice.h>
31#include <linux/inetdevice.h> 30#include <linux/inetdevice.h>
diff --git a/net/irda/irlap.c b/net/irda/irlap.c
index a16528657b4c..cade355ac8af 100644
--- a/net/irda/irlap.c
+++ b/net/irda/irlap.c
@@ -29,7 +29,6 @@
29 * 29 *
30 ********************************************************************/ 30 ********************************************************************/
31 31
32#include <linux/config.h>
33#include <linux/slab.h> 32#include <linux/slab.h>
34#include <linux/string.h> 33#include <linux/string.h>
35#include <linux/skbuff.h> 34#include <linux/skbuff.h>
diff --git a/net/irda/irlap_event.c b/net/irda/irlap_event.c
index a505b5457608..99faff68c399 100644
--- a/net/irda/irlap_event.c
+++ b/net/irda/irlap_event.c
@@ -25,7 +25,6 @@
25 * 25 *
26 ********************************************************************/ 26 ********************************************************************/
27 27
28#include <linux/config.h>
29#include <linux/string.h> 28#include <linux/string.h>
30#include <linux/kernel.h> 29#include <linux/kernel.h>
31#include <linux/delay.h> 30#include <linux/delay.h>
diff --git a/net/irda/irlmp.c b/net/irda/irlmp.c
index 57ea160f470b..129ad64c15bb 100644
--- a/net/irda/irlmp.c
+++ b/net/irda/irlmp.c
@@ -24,7 +24,6 @@
24 * 24 *
25 ********************************************************************/ 25 ********************************************************************/
26 26
27#include <linux/config.h>
28#include <linux/module.h> 27#include <linux/module.h>
29#include <linux/slab.h> 28#include <linux/slab.h>
30#include <linux/string.h> 29#include <linux/string.h>
diff --git a/net/irda/irlmp_event.c b/net/irda/irlmp_event.c
index 26649f6528e6..4c90dd1b4503 100644
--- a/net/irda/irlmp_event.c
+++ b/net/irda/irlmp_event.c
@@ -24,7 +24,6 @@
24 * 24 *
25 ********************************************************************/ 25 ********************************************************************/
26 26
27#include <linux/config.h>
28#include <linux/kernel.h> 27#include <linux/kernel.h>
29 28
30#include <net/irda/irda.h> 29#include <net/irda/irda.h>
diff --git a/net/irda/irlmp_frame.c b/net/irda/irlmp_frame.c
index 91cd268172fa..39761a1d18f5 100644
--- a/net/irda/irlmp_frame.c
+++ b/net/irda/irlmp_frame.c
@@ -24,7 +24,6 @@
24 * 24 *
25 ********************************************************************/ 25 ********************************************************************/
26 26
27#include <linux/config.h>
28#include <linux/skbuff.h> 27#include <linux/skbuff.h>
29#include <linux/kernel.h> 28#include <linux/kernel.h>
30 29
diff --git a/net/irda/irmod.c b/net/irda/irmod.c
index 634901dd156f..2869b16e417d 100644
--- a/net/irda/irmod.c
+++ b/net/irda/irmod.c
@@ -31,7 +31,6 @@
31 * Jean II 31 * Jean II
32 */ 32 */
33 33
34#include <linux/config.h>
35#include <linux/module.h> 34#include <linux/module.h>
36#include <linux/moduleparam.h> 35#include <linux/moduleparam.h>
37 36
diff --git a/net/irda/irnet/irnet.h b/net/irda/irnet/irnet.h
index ad6caba02a7b..80887528e77e 100644
--- a/net/irda/irnet/irnet.h
+++ b/net/irda/irnet/irnet.h
@@ -248,7 +248,6 @@
248#include <linux/miscdevice.h> 248#include <linux/miscdevice.h>
249#include <linux/poll.h> 249#include <linux/poll.h>
250#include <linux/capability.h> 250#include <linux/capability.h>
251#include <linux/config.h>
252#include <linux/ctype.h> /* isspace() */ 251#include <linux/ctype.h> /* isspace() */
253#include <asm/uaccess.h> 252#include <asm/uaccess.h>
254#include <linux/init.h> 253#include <linux/init.h>
diff --git a/net/irda/irsysctl.c b/net/irda/irsysctl.c
index 1b1c4193359a..86805c3d8324 100644
--- a/net/irda/irsysctl.c
+++ b/net/irda/irsysctl.c
@@ -23,7 +23,6 @@
23 * 23 *
24 ********************************************************************/ 24 ********************************************************************/
25 25
26#include <linux/config.h>
27#include <linux/mm.h> 26#include <linux/mm.h>
28#include <linux/ctype.h> 27#include <linux/ctype.h>
29#include <linux/sysctl.h> 28#include <linux/sysctl.h>
diff --git a/net/irda/irttp.c b/net/irda/irttp.c
index 8aff254cb418..49c51c5f1a86 100644
--- a/net/irda/irttp.c
+++ b/net/irda/irttp.c
@@ -24,7 +24,6 @@
24 * 24 *
25 ********************************************************************/ 25 ********************************************************************/
26 26
27#include <linux/config.h>
28#include <linux/skbuff.h> 27#include <linux/skbuff.h>
29#include <linux/init.h> 28#include <linux/init.h>
30#include <linux/seq_file.h> 29#include <linux/seq_file.h>
diff --git a/net/irda/qos.c b/net/irda/qos.c
index ddfb5c502a90..95a69c013ee8 100644
--- a/net/irda/qos.c
+++ b/net/irda/qos.c
@@ -30,7 +30,6 @@
30 * 30 *
31 ********************************************************************/ 31 ********************************************************************/
32 32
33#include <linux/config.h>
34#include <asm/byteorder.h> 33#include <asm/byteorder.h>
35 34
36#include <net/irda/irda.h> 35#include <net/irda/irda.h>
diff --git a/net/irda/timer.c b/net/irda/timer.c
index 0e17f976add6..3871a2b911f9 100644
--- a/net/irda/timer.c
+++ b/net/irda/timer.c
@@ -25,7 +25,6 @@
25 ********************************************************************/ 25 ********************************************************************/
26 26
27#include <asm/system.h> 27#include <asm/system.h>
28#include <linux/config.h>
29#include <linux/delay.h> 28#include <linux/delay.h>
30 29
31#include <net/irda/timer.h> 30#include <net/irda/timer.h>
diff --git a/net/key/af_key.c b/net/key/af_key.c
index d5e2121ea207..3a95b2ee4690 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -14,7 +14,6 @@
14 * Derek Atkins <derek@ihtfp.com> 14 * Derek Atkins <derek@ihtfp.com>
15 */ 15 */
16 16
17#include <linux/config.h>
18#include <linux/capability.h> 17#include <linux/capability.h>
19#include <linux/module.h> 18#include <linux/module.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c
index 75c9b1480801..d6cfe84d521b 100644
--- a/net/llc/af_llc.c
+++ b/net/llc/af_llc.c
@@ -20,7 +20,6 @@
20 * 20 *
21 * See the GNU General Public License for more details. 21 * See the GNU General Public License for more details.
22 */ 22 */
23#include <linux/config.h>
24#include <linux/compiler.h> 23#include <linux/compiler.h>
25#include <linux/kernel.h> 24#include <linux/kernel.h>
26#include <linux/module.h> 25#include <linux/module.h>
diff --git a/net/llc/llc_if.c b/net/llc/llc_if.c
index 5ae47be7dde0..a89917130a7b 100644
--- a/net/llc/llc_if.c
+++ b/net/llc/llc_if.c
@@ -11,7 +11,6 @@
11 * 11 *
12 * See the GNU General Public License for more details. 12 * See the GNU General Public License for more details.
13 */ 13 */
14#include <linux/config.h>
15#include <linux/module.h> 14#include <linux/module.h>
16#include <linux/kernel.h> 15#include <linux/kernel.h>
17#include <linux/netdevice.h> 16#include <linux/netdevice.h>
diff --git a/net/llc/llc_proc.c b/net/llc/llc_proc.c
index bd531cb235a7..19308fece3ad 100644
--- a/net/llc/llc_proc.c
+++ b/net/llc/llc_proc.c
@@ -12,7 +12,6 @@
12 * See the GNU General Public License for more details. 12 * See the GNU General Public License for more details.
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/init.h> 15#include <linux/init.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <linux/proc_fs.h> 17#include <linux/proc_fs.h>
diff --git a/net/llc/llc_station.c b/net/llc/llc_station.c
index f37dbf8ef126..8275bd33bd9d 100644
--- a/net/llc/llc_station.c
+++ b/net/llc/llc_station.c
@@ -11,7 +11,6 @@
11 * 11 *
12 * See the GNU General Public License for more details. 12 * See the GNU General Public License for more details.
13 */ 13 */
14#include <linux/config.h>
15#include <linux/init.h> 14#include <linux/init.h>
16#include <linux/module.h> 15#include <linux/module.h>
17#include <net/llc.h> 16#include <net/llc.h>
diff --git a/net/llc/sysctl_net_llc.c b/net/llc/sysctl_net_llc.c
index d1eaddb13633..45d7dd92a088 100644
--- a/net/llc/sysctl_net_llc.c
+++ b/net/llc/sysctl_net_llc.c
@@ -4,7 +4,6 @@
4 * Arnaldo Carvalho de Melo <acme@conectiva.com.br> 4 * Arnaldo Carvalho de Melo <acme@conectiva.com.br>
5 */ 5 */
6 6
7#include <linux/config.h>
8#include <linux/mm.h> 7#include <linux/mm.h>
9#include <linux/init.h> 8#include <linux/init.h>
10#include <linux/sysctl.h> 9#include <linux/sysctl.h>
diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
index b1622b7de1cf..42a178aa30f9 100644
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
@@ -411,7 +411,10 @@ config NETFILTER_XT_MATCH_STATISTIC
411 tristate '"statistic" match support' 411 tristate '"statistic" match support'
412 depends on NETFILTER_XTABLES 412 depends on NETFILTER_XTABLES
413 help 413 help
414 statistic module 414 This option adds a `statistic' match, which allows you to match
415 on packets periodically or randomly with a given percentage.
416
417 To compile it as a module, choose M here. If unsure, say N.
415 418
416config NETFILTER_XT_MATCH_STRING 419config NETFILTER_XT_MATCH_STRING
417 tristate '"string" match support' 420 tristate '"string" match support'
diff --git a/net/netfilter/core.c b/net/netfilter/core.c
index 8455a32ea5c4..5d29d5e23624 100644
--- a/net/netfilter/core.c
+++ b/net/netfilter/core.c
@@ -10,7 +10,6 @@
10 * 15-Mar-2000: Added NF_REPEAT --RR. 10 * 15-Mar-2000: Added NF_REPEAT --RR.
11 * 08-May-2003: Internal logging interface added by Jozsef Kadlecsik. 11 * 08-May-2003: Internal logging interface added by Jozsef Kadlecsik.
12 */ 12 */
13#include <linux/config.h>
14#include <linux/kernel.h> 13#include <linux/kernel.h>
15#include <linux/netfilter.h> 14#include <linux/netfilter.h>
16#include <net/protocol.h> 15#include <net/protocol.h>
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index cd299f4b7db1..8f2261965a68 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -29,7 +29,6 @@
29 * Derived from net/ipv4/netfilter/ip_conntrack_core.c 29 * Derived from net/ipv4/netfilter/ip_conntrack_core.c
30 */ 30 */
31 31
32#include <linux/config.h>
33#include <linux/types.h> 32#include <linux/types.h>
34#include <linux/netfilter.h> 33#include <linux/netfilter.h>
35#include <linux/module.h> 34#include <linux/module.h>
diff --git a/net/netfilter/nf_conntrack_ftp.c b/net/netfilter/nf_conntrack_ftp.c
index 11d3be243536..960972d225f9 100644
--- a/net/netfilter/nf_conntrack_ftp.c
+++ b/net/netfilter/nf_conntrack_ftp.c
@@ -15,7 +15,6 @@
15 * Derived from net/ipv4/netfilter/ip_conntrack_ftp.c 15 * Derived from net/ipv4/netfilter/ip_conntrack_ftp.c
16 */ 16 */
17 17
18#include <linux/config.h>
19#include <linux/module.h> 18#include <linux/module.h>
20#include <linux/moduleparam.h> 19#include <linux/moduleparam.h>
21#include <linux/netfilter.h> 20#include <linux/netfilter.h>
diff --git a/net/netfilter/nf_conntrack_l3proto_generic.c b/net/netfilter/nf_conntrack_l3proto_generic.c
index 3fc58e454d4e..21e0bc91cf23 100644
--- a/net/netfilter/nf_conntrack_l3proto_generic.c
+++ b/net/netfilter/nf_conntrack_l3proto_generic.c
@@ -15,7 +15,6 @@
15 * Yasuyuki Kozakai @USAGI <yasuyuki.kozakai@toshiba.co.jp> 15 * Yasuyuki Kozakai @USAGI <yasuyuki.kozakai@toshiba.co.jp>
16 */ 16 */
17 17
18#include <linux/config.h>
19#include <linux/types.h> 18#include <linux/types.h>
20#include <linux/ip.h> 19#include <linux/ip.h>
21#include <linux/netfilter.h> 20#include <linux/netfilter.h>
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index b8c7c567c9df..af4845971f70 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -29,6 +29,7 @@
29#include <linux/errno.h> 29#include <linux/errno.h>
30#include <linux/netlink.h> 30#include <linux/netlink.h>
31#include <linux/spinlock.h> 31#include <linux/spinlock.h>
32#include <linux/interrupt.h>
32#include <linux/notifier.h> 33#include <linux/notifier.h>
33 34
34#include <linux/netfilter.h> 35#include <linux/netfilter.h>
diff --git a/net/netfilter/nf_conntrack_proto_sctp.c b/net/netfilter/nf_conntrack_proto_sctp.c
index 0c6da496cfa9..9bd8a7877fd5 100644
--- a/net/netfilter/nf_conntrack_proto_sctp.c
+++ b/net/netfilter/nf_conntrack_proto_sctp.c
@@ -28,6 +28,8 @@
28#include <linux/sctp.h> 28#include <linux/sctp.h>
29#include <linux/string.h> 29#include <linux/string.h>
30#include <linux/seq_file.h> 30#include <linux/seq_file.h>
31#include <linux/spinlock.h>
32#include <linux/interrupt.h>
31 33
32#include <net/netfilter/nf_conntrack.h> 34#include <net/netfilter/nf_conntrack.h>
33#include <net/netfilter/nf_conntrack_protocol.h> 35#include <net/netfilter/nf_conntrack_protocol.h>
@@ -259,7 +261,7 @@ static int do_basic_checks(struct nf_conn *conntrack,
259 } 261 }
260 262
261 DEBUGP("Basic checks passed\n"); 263 DEBUGP("Basic checks passed\n");
262 return 0; 264 return count == 0;
263} 265}
264 266
265static int new_state(enum ip_conntrack_dir dir, 267static int new_state(enum ip_conntrack_dir dir,
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c
index 12fb7c0a1509..af8adcba23a7 100644
--- a/net/netfilter/nf_conntrack_proto_tcp.c
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
@@ -24,7 +24,6 @@
24 * version 2.2 24 * version 2.2
25 */ 25 */
26 26
27#include <linux/config.h>
28#include <linux/types.h> 27#include <linux/types.h>
29#include <linux/sched.h> 28#include <linux/sched.h>
30#include <linux/timer.h> 29#include <linux/timer.h>
diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c
index e34c574f0351..5fcab2ef231f 100644
--- a/net/netfilter/nf_conntrack_standalone.c
+++ b/net/netfilter/nf_conntrack_standalone.c
@@ -17,7 +17,6 @@
17 * Derived from net/ipv4/netfilter/ip_conntrack_standalone.c 17 * Derived from net/ipv4/netfilter/ip_conntrack_standalone.c
18 */ 18 */
19 19
20#include <linux/config.h>
21#include <linux/types.h> 20#include <linux/types.h>
22#include <linux/netfilter.h> 21#include <linux/netfilter.h>
23#include <linux/module.h> 22#include <linux/module.h>
diff --git a/net/netfilter/nf_internals.h b/net/netfilter/nf_internals.h
index 6bdee2910617..86e392bfe833 100644
--- a/net/netfilter/nf_internals.h
+++ b/net/netfilter/nf_internals.h
@@ -1,7 +1,6 @@
1#ifndef _NF_INTERNALS_H 1#ifndef _NF_INTERNALS_H
2#define _NF_INTERNALS_H 2#define _NF_INTERNALS_H
3 3
4#include <linux/config.h>
5#include <linux/list.h> 4#include <linux/list.h>
6#include <linux/skbuff.h> 5#include <linux/skbuff.h>
7#include <linux/netdevice.h> 6#include <linux/netdevice.h>
diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c
index 3e76bd0824a2..8901b3a07f7e 100644
--- a/net/netfilter/nf_log.c
+++ b/net/netfilter/nf_log.c
@@ -1,4 +1,3 @@
1#include <linux/config.h>
2#include <linux/kernel.h> 1#include <linux/kernel.h>
3#include <linux/init.h> 2#include <linux/init.h>
4#include <linux/module.h> 3#include <linux/module.h>
diff --git a/net/netfilter/nf_queue.c b/net/netfilter/nf_queue.c
index ee8f70889f47..bb6fcee452ca 100644
--- a/net/netfilter/nf_queue.c
+++ b/net/netfilter/nf_queue.c
@@ -1,4 +1,3 @@
1#include <linux/config.h>
2#include <linux/kernel.h> 1#include <linux/kernel.h>
3#include <linux/init.h> 2#include <linux/init.h>
4#include <linux/module.h> 3#include <linux/module.h>
diff --git a/net/netfilter/nf_sockopt.c b/net/netfilter/nf_sockopt.c
index 0a63d7dac7be..c2e44e90e437 100644
--- a/net/netfilter/nf_sockopt.c
+++ b/net/netfilter/nf_sockopt.c
@@ -1,4 +1,3 @@
1#include <linux/config.h>
2#include <linux/kernel.h> 1#include <linux/kernel.h>
3#include <linux/init.h> 2#include <linux/init.h>
4#include <linux/module.h> 3#include <linux/module.h>
diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c
index b88e82a1a987..52fdfa2686c9 100644
--- a/net/netfilter/nfnetlink.c
+++ b/net/netfilter/nfnetlink.c
@@ -14,7 +14,6 @@
14 * of the GNU General Public License, incorporated herein by reference. 14 * of the GNU General Public License, incorporated herein by reference.
15 */ 15 */
16 16
17#include <linux/config.h>
18#include <linux/module.h> 17#include <linux/module.h>
19#include <linux/types.h> 18#include <linux/types.h>
20#include <linux/socket.h> 19#include <linux/socket.h>
@@ -229,7 +228,7 @@ static int nfnetlink_rcv_msg(struct sk_buff *skb,
229 NFNL_SUBSYS_ID(nlh->nlmsg_type), 228 NFNL_SUBSYS_ID(nlh->nlmsg_type),
230 NFNL_MSG_TYPE(nlh->nlmsg_type)); 229 NFNL_MSG_TYPE(nlh->nlmsg_type));
231 230
232 if (!cap_raised(NETLINK_CB(skb).eff_cap, CAP_NET_ADMIN)) { 231 if (security_netlink_recv(skb, CAP_NET_ADMIN)) {
233 DEBUGP("missing CAP_NET_ADMIN\n"); 232 DEBUGP("missing CAP_NET_ADMIN\n");
234 *errp = -EPERM; 233 *errp = -EPERM;
235 return -1; 234 return -1;
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c
index 86a4ac33de34..49ef41e34c48 100644
--- a/net/netfilter/nfnetlink_queue.c
+++ b/net/netfilter/nfnetlink_queue.c
@@ -680,11 +680,19 @@ dev_cmp(struct nfqnl_queue_entry *entry, unsigned long ifindex)
680 if (entinf->indev) 680 if (entinf->indev)
681 if (entinf->indev->ifindex == ifindex) 681 if (entinf->indev->ifindex == ifindex)
682 return 1; 682 return 1;
683
684 if (entinf->outdev) 683 if (entinf->outdev)
685 if (entinf->outdev->ifindex == ifindex) 684 if (entinf->outdev->ifindex == ifindex)
686 return 1; 685 return 1;
687 686#ifdef CONFIG_BRIDGE_NETFILTER
687 if (entry->skb->nf_bridge) {
688 if (entry->skb->nf_bridge->physindev &&
689 entry->skb->nf_bridge->physindev->ifindex == ifindex)
690 return 1;
691 if (entry->skb->nf_bridge->physoutdev &&
692 entry->skb->nf_bridge->physoutdev->ifindex == ifindex)
693 return 1;
694 }
695#endif
688 return 0; 696 return 0;
689} 697}
690 698
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index 99293c63ff73..174e8f970095 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -13,7 +13,6 @@
13 * 13 *
14 */ 14 */
15 15
16#include <linux/config.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <linux/socket.h> 17#include <linux/socket.h>
19#include <linux/net.h> 18#include <linux/net.h>
diff --git a/net/netfilter/xt_policy.c b/net/netfilter/xt_policy.c
index a3aa62fbda6f..ba1ca03abad3 100644
--- a/net/netfilter/xt_policy.c
+++ b/net/netfilter/xt_policy.c
@@ -8,7 +8,6 @@
8 */ 8 */
9 9
10#include <linux/kernel.h> 10#include <linux/kernel.h>
11#include <linux/config.h>
12#include <linux/module.h> 11#include <linux/module.h>
13#include <linux/skbuff.h> 12#include <linux/skbuff.h>
14#include <linux/init.h> 13#include <linux/init.h>
diff --git a/net/netfilter/xt_sctp.c b/net/netfilter/xt_sctp.c
index 9316c753692f..843383e01d41 100644
--- a/net/netfilter/xt_sctp.c
+++ b/net/netfilter/xt_sctp.c
@@ -151,7 +151,7 @@ match(const struct sk_buff *skb,
151 && SCCHECK(((ntohs(sh->dest) >= info->dpts[0]) 151 && SCCHECK(((ntohs(sh->dest) >= info->dpts[0])
152 && (ntohs(sh->dest) <= info->dpts[1])), 152 && (ntohs(sh->dest) <= info->dpts[1])),
153 XT_SCTP_DEST_PORTS, info->flags, info->invflags) 153 XT_SCTP_DEST_PORTS, info->flags, info->invflags)
154 && SCCHECK(match_packet(skb, protoff, 154 && SCCHECK(match_packet(skb, protoff + sizeof (sctp_sctphdr_t),
155 info->chunkmap, info->chunk_match_type, 155 info->chunkmap, info->chunk_match_type,
156 info->flag_info, info->flag_count, 156 info->flag_info, info->flag_count,
157 hotdrop), 157 hotdrop),
diff --git a/net/netfilter/xt_tcpudp.c b/net/netfilter/xt_tcpudp.c
index 1b61dac9c873..a9a63aa68936 100644
--- a/net/netfilter/xt_tcpudp.c
+++ b/net/netfilter/xt_tcpudp.c
@@ -260,7 +260,7 @@ static int __init xt_tcpudp_init(void)
260 return ret; 260 return ret;
261 261
262out_unreg_udp: 262out_unreg_udp:
263 xt_unregister_match(&tcp_matchstruct); 263 xt_unregister_match(&udp_matchstruct);
264out_unreg_tcp6: 264out_unreg_tcp6:
265 xt_unregister_match(&tcp6_matchstruct); 265 xt_unregister_match(&tcp6_matchstruct);
266out_unreg_tcp: 266out_unreg_tcp:
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 3862e73d14d7..70cee82a98bf 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -21,7 +21,6 @@
21 * mandatory if CONFIG_NET=y these days 21 * mandatory if CONFIG_NET=y these days
22 */ 22 */
23 23
24#include <linux/config.h>
25#include <linux/module.h> 24#include <linux/module.h>
26 25
27#include <linux/capability.h> 26#include <linux/capability.h>
diff --git a/net/netlink/attr.c b/net/netlink/attr.c
index fffef4ab276f..dddbd15135a8 100644
--- a/net/netlink/attr.c
+++ b/net/netlink/attr.c
@@ -5,7 +5,6 @@
5 * Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> 5 * Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
6 */ 6 */
7 7
8#include <linux/config.h>
9#include <linux/module.h> 8#include <linux/module.h>
10#include <linux/kernel.h> 9#include <linux/kernel.h>
11#include <linux/errno.h> 10#include <linux/errno.h>
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index f329b72578f5..a298f77cc3e3 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -5,7 +5,6 @@
5 * Thomas Graf <tgraf@suug.ch> 5 * Thomas Graf <tgraf@suug.ch>
6 */ 6 */
7 7
8#include <linux/config.h>
9#include <linux/module.h> 8#include <linux/module.h>
10#include <linux/kernel.h> 9#include <linux/kernel.h>
11#include <linux/errno.h> 10#include <linux/errno.h>
@@ -320,7 +319,7 @@ static int genl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
320 goto errout; 319 goto errout;
321 } 320 }
322 321
323 if ((ops->flags & GENL_ADMIN_PERM) && security_netlink_recv(skb)) { 322 if ((ops->flags & GENL_ADMIN_PERM) && security_netlink_recv(skb, CAP_NET_ADMIN)) {
324 err = -EPERM; 323 err = -EPERM;
325 goto errout; 324 goto errout;
326 } 325 }
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
index 3669cb953e6e..eba6df054b1f 100644
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -8,7 +8,6 @@
8 * Copyright Alan Cox GW4PTS (alan@lxorguk.ukuu.org.uk) 8 * Copyright Alan Cox GW4PTS (alan@lxorguk.ukuu.org.uk)
9 * Copyright Darryl Miles G7LED (dlm@g7led.demon.co.uk) 9 * Copyright Darryl Miles G7LED (dlm@g7led.demon.co.uk)
10 */ 10 */
11#include <linux/config.h>
12#include <linux/module.h> 11#include <linux/module.h>
13#include <linux/moduleparam.h> 12#include <linux/moduleparam.h>
14#include <linux/capability.h> 13#include <linux/capability.h>
diff --git a/net/netrom/nr_dev.c b/net/netrom/nr_dev.c
index 621e5586ab03..9b8eb54971ab 100644
--- a/net/netrom/nr_dev.c
+++ b/net/netrom/nr_dev.c
@@ -6,7 +6,6 @@
6 * 6 *
7 * Copyright Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk) 7 * Copyright Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk)
8 */ 8 */
9#include <linux/config.h>
10#include <linux/module.h> 9#include <linux/module.h>
11#include <linux/proc_fs.h> 10#include <linux/proc_fs.h>
12#include <linux/kernel.h> 11#include <linux/kernel.h>
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 9db7dbdb16e6..f9cef3671593 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -49,7 +49,6 @@
49 * 49 *
50 */ 50 */
51 51
52#include <linux/config.h>
53#include <linux/types.h> 52#include <linux/types.h>
54#include <linux/sched.h> 53#include <linux/sched.h>
55#include <linux/mm.h> 54#include <linux/mm.h>
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index 55564efccf11..7799fe82aeb6 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -10,7 +10,6 @@
10 * Copyright (C) Tomi Manninen OH2BNS (oh2bns@sral.fi) 10 * Copyright (C) Tomi Manninen OH2BNS (oh2bns@sral.fi)
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/capability.h> 13#include <linux/capability.h>
15#include <linux/module.h> 14#include <linux/module.h>
16#include <linux/moduleparam.h> 15#include <linux/moduleparam.h>
diff --git a/net/rose/rose_dev.c b/net/rose/rose_dev.c
index 2a1bf8e119e5..9d0bf2a1ea3f 100644
--- a/net/rose/rose_dev.c
+++ b/net/rose/rose_dev.c
@@ -6,7 +6,6 @@
6 * 6 *
7 * Copyright (C) Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk) 7 * Copyright (C) Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk)
8 */ 8 */
9#include <linux/config.h>
10#include <linux/module.h> 9#include <linux/module.h>
11#include <linux/proc_fs.h> 10#include <linux/proc_fs.h>
12#include <linux/kernel.h> 11#include <linux/kernel.h>
diff --git a/net/rxrpc/rxrpc_syms.c b/net/rxrpc/rxrpc_syms.c
index 56adf16fed0c..9896fd87a4d4 100644
--- a/net/rxrpc/rxrpc_syms.c
+++ b/net/rxrpc/rxrpc_syms.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/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14 13
15#include <rxrpc/transport.h> 14#include <rxrpc/transport.h>
diff --git a/net/rxrpc/sysctl.c b/net/rxrpc/sysctl.c
index fbf98729c748..6374df7e77d1 100644
--- a/net/rxrpc/sysctl.c
+++ b/net/rxrpc/sysctl.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/config.h>
13#include <linux/sched.h> 12#include <linux/sched.h>
14#include <linux/slab.h> 13#include <linux/slab.h>
15#include <linux/module.h> 14#include <linux/module.h>
diff --git a/net/sched/Kconfig b/net/sched/Kconfig
index 13eeee582886..8298ea9ffe19 100644
--- a/net/sched/Kconfig
+++ b/net/sched/Kconfig
@@ -305,7 +305,7 @@ config NET_CLS_U32
305 tristate "Universal 32bit comparisons w/ hashing (U32)" 305 tristate "Universal 32bit comparisons w/ hashing (U32)"
306 select NET_CLS 306 select NET_CLS
307 ---help--- 307 ---help---
308 Say Y here to be able to classify packetes using a universal 308 Say Y here to be able to classify packets using a universal
309 32bit pieces based comparison scheme. 309 32bit pieces based comparison scheme.
310 310
311 To compile this code as a module, choose M here: the 311 To compile this code as a module, choose M here: the
@@ -485,7 +485,7 @@ config NET_ACT_IPT
485 tristate "IPtables targets" 485 tristate "IPtables targets"
486 depends on NET_CLS_ACT && NETFILTER && IP_NF_IPTABLES 486 depends on NET_CLS_ACT && NETFILTER && IP_NF_IPTABLES
487 ---help--- 487 ---help---
488 Say Y here to be able to invoke iptables targets after succesful 488 Say Y here to be able to invoke iptables targets after successful
489 classification. 489 classification.
490 490
491 To compile this code as a module, choose M here: the 491 To compile this code as a module, choose M here: the
@@ -537,8 +537,8 @@ config NET_ESTIMATOR
537 ---help--- 537 ---help---
538 Say Y here to allow using rate estimators to estimate the current 538 Say Y here to allow using rate estimators to estimate the current
539 rate-of-flow for network devices, queues, etc. This module is 539 rate-of-flow for network devices, queues, etc. This module is
540 automaticaly selected if needed but can be selected manually for 540 automatically selected if needed but can be selected manually for
541 statstical purposes. 541 statistical purposes.
542 542
543endif # NET_SCHED 543endif # NET_SCHED
544 544
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 2ffa11c6e8de..5b9397b33238 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -14,7 +14,6 @@
14#include <asm/uaccess.h> 14#include <asm/uaccess.h>
15#include <asm/system.h> 15#include <asm/system.h>
16#include <linux/bitops.h> 16#include <linux/bitops.h>
17#include <linux/config.h>
18#include <linux/types.h> 17#include <linux/types.h>
19#include <linux/kernel.h> 18#include <linux/kernel.h>
20#include <linux/sched.h> 19#include <linux/sched.h>
diff --git a/net/sched/act_gact.c b/net/sched/act_gact.c
index a1e68f78dcc2..e75a147ad60f 100644
--- a/net/sched/act_gact.c
+++ b/net/sched/act_gact.c
@@ -13,7 +13,6 @@
13#include <asm/uaccess.h> 13#include <asm/uaccess.h>
14#include <asm/system.h> 14#include <asm/system.h>
15#include <linux/bitops.h> 15#include <linux/bitops.h>
16#include <linux/config.h>
17#include <linux/types.h> 16#include <linux/types.h>
18#include <linux/kernel.h> 17#include <linux/kernel.h>
19#include <linux/sched.h> 18#include <linux/sched.h>
diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c
index 37640c6fc014..d799e01248c4 100644
--- a/net/sched/act_ipt.c
+++ b/net/sched/act_ipt.c
@@ -14,7 +14,6 @@
14#include <asm/uaccess.h> 14#include <asm/uaccess.h>
15#include <asm/system.h> 15#include <asm/system.h>
16#include <asm/bitops.h> 16#include <asm/bitops.h>
17#include <linux/config.h>
18#include <linux/types.h> 17#include <linux/types.h>
19#include <linux/kernel.h> 18#include <linux/kernel.h>
20#include <linux/sched.h> 19#include <linux/sched.h>
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index 4fcccbd50885..fc562047ecc5 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -15,7 +15,6 @@
15#include <asm/uaccess.h> 15#include <asm/uaccess.h>
16#include <asm/system.h> 16#include <asm/system.h>
17#include <asm/bitops.h> 17#include <asm/bitops.h>
18#include <linux/config.h>
19#include <linux/types.h> 18#include <linux/types.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
21#include <linux/sched.h> 20#include <linux/sched.h>
diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c
index 1742a68e0122..58b3a8652042 100644
--- a/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -12,7 +12,6 @@
12#include <asm/uaccess.h> 12#include <asm/uaccess.h>
13#include <asm/system.h> 13#include <asm/system.h>
14#include <asm/bitops.h> 14#include <asm/bitops.h>
15#include <linux/config.h>
16#include <linux/types.h> 15#include <linux/types.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <linux/sched.h> 17#include <linux/sched.h>
diff --git a/net/sched/act_police.c b/net/sched/act_police.c
index 24c348fa8922..47e00bd9625e 100644
--- a/net/sched/act_police.c
+++ b/net/sched/act_police.c
@@ -13,7 +13,6 @@
13#include <asm/uaccess.h> 13#include <asm/uaccess.h>
14#include <asm/system.h> 14#include <asm/system.h>
15#include <linux/bitops.h> 15#include <linux/bitops.h>
16#include <linux/config.h>
17#include <linux/module.h> 16#include <linux/module.h>
18#include <linux/types.h> 17#include <linux/types.h>
19#include <linux/kernel.h> 18#include <linux/kernel.h>
diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c
index e5f2e1f431e2..17105c82537f 100644
--- a/net/sched/act_simple.c
+++ b/net/sched/act_simple.c
@@ -10,7 +10,6 @@
10 * 10 *
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <linux/init.h> 14#include <linux/init.h>
16#include <linux/kernel.h> 15#include <linux/kernel.h>
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index b4d89fbb3782..7e14f14058e9 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -17,7 +17,6 @@
17#include <asm/uaccess.h> 17#include <asm/uaccess.h>
18#include <asm/system.h> 18#include <asm/system.h>
19#include <linux/bitops.h> 19#include <linux/bitops.h>
20#include <linux/config.h>
21#include <linux/module.h> 20#include <linux/module.h>
22#include <linux/types.h> 21#include <linux/types.h>
23#include <linux/kernel.h> 22#include <linux/kernel.h>
diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c
index dfb300bb6baa..61507f006b11 100644
--- a/net/sched/cls_basic.c
+++ b/net/sched/cls_basic.c
@@ -9,7 +9,6 @@
9 * Authors: Thomas Graf <tgraf@suug.ch> 9 * Authors: Thomas Graf <tgraf@suug.ch>
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/types.h> 13#include <linux/types.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
diff --git a/net/sched/cls_fw.c b/net/sched/cls_fw.c
index 75470486e405..d41de91fc4f6 100644
--- a/net/sched/cls_fw.c
+++ b/net/sched/cls_fw.c
@@ -18,7 +18,6 @@
18 * 18 *
19 */ 19 */
20 20
21#include <linux/config.h>
22#include <linux/module.h> 21#include <linux/module.h>
23#include <asm/uaccess.h> 22#include <asm/uaccess.h>
24#include <asm/system.h> 23#include <asm/system.h>
diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c
index 520ff716dab2..c2e71900f7bd 100644
--- a/net/sched/cls_route.c
+++ b/net/sched/cls_route.c
@@ -10,7 +10,6 @@
10 */ 10 */
11 11
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/config.h>
14#include <asm/uaccess.h> 13#include <asm/uaccess.h>
15#include <asm/system.h> 14#include <asm/system.h>
16#include <linux/bitops.h> 15#include <linux/bitops.h>
diff --git a/net/sched/cls_rsvp.h b/net/sched/cls_rsvp.h
index 572f06be3b02..ba8741971629 100644
--- a/net/sched/cls_rsvp.h
+++ b/net/sched/cls_rsvp.h
@@ -65,7 +65,6 @@
65 Well, as result, despite its simplicity, we get a pretty 65 Well, as result, despite its simplicity, we get a pretty
66 powerful classification engine. */ 66 powerful classification engine. */
67 67
68#include <linux/config.h>
69 68
70struct rsvp_head 69struct rsvp_head
71{ 70{
diff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c
index 9f921174c8ab..7870e7bb0bac 100644
--- a/net/sched/cls_tcindex.c
+++ b/net/sched/cls_tcindex.c
@@ -4,7 +4,6 @@
4 * Written 1998,1999 by Werner Almesberger, EPFL ICA 4 * Written 1998,1999 by Werner Almesberger, EPFL ICA
5 */ 5 */
6 6
7#include <linux/config.h>
8#include <linux/module.h> 7#include <linux/module.h>
9#include <linux/types.h> 8#include <linux/types.h>
10#include <linux/kernel.h> 9#include <linux/kernel.h>
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index 78e052591fa9..d712edcd1bcf 100644
--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -33,7 +33,6 @@
33#include <asm/uaccess.h> 33#include <asm/uaccess.h>
34#include <asm/system.h> 34#include <asm/system.h>
35#include <linux/bitops.h> 35#include <linux/bitops.h>
36#include <linux/config.h>
37#include <linux/module.h> 36#include <linux/module.h>
38#include <linux/types.h> 37#include <linux/types.h>
39#include <linux/kernel.h> 38#include <linux/kernel.h>
diff --git a/net/sched/em_cmp.c b/net/sched/em_cmp.c
index bf1f00f8b1bf..8ed93c39b4ea 100644
--- a/net/sched/em_cmp.c
+++ b/net/sched/em_cmp.c
@@ -9,7 +9,6 @@
9 * Authors: Thomas Graf <tgraf@suug.ch> 9 * Authors: Thomas Graf <tgraf@suug.ch>
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/types.h> 13#include <linux/types.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
diff --git a/net/sched/em_meta.c b/net/sched/em_meta.c
index 700844d49d79..698372954f4d 100644
--- a/net/sched/em_meta.c
+++ b/net/sched/em_meta.c
@@ -58,7 +58,6 @@
58 * only available if that subsytem is enabled in the kernel. 58 * only available if that subsytem is enabled in the kernel.
59 */ 59 */
60 60
61#include <linux/config.h>
62#include <linux/module.h> 61#include <linux/module.h>
63#include <linux/types.h> 62#include <linux/types.h>
64#include <linux/kernel.h> 63#include <linux/kernel.h>
diff --git a/net/sched/em_nbyte.c b/net/sched/em_nbyte.c
index 71ea926a9f09..cc80babfd79f 100644
--- a/net/sched/em_nbyte.c
+++ b/net/sched/em_nbyte.c
@@ -9,7 +9,6 @@
9 * Authors: Thomas Graf <tgraf@suug.ch> 9 * Authors: Thomas Graf <tgraf@suug.ch>
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/types.h> 13#include <linux/types.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
diff --git a/net/sched/em_text.c b/net/sched/em_text.c
index 77beabc91fa3..aa17d8f7c4c8 100644
--- a/net/sched/em_text.c
+++ b/net/sched/em_text.c
@@ -9,7 +9,6 @@
9 * Authors: Thomas Graf <tgraf@suug.ch> 9 * Authors: Thomas Graf <tgraf@suug.ch>
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/types.h> 13#include <linux/types.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
diff --git a/net/sched/em_u32.c b/net/sched/em_u32.c
index 34e7e51e601e..e3ddfce0ac8d 100644
--- a/net/sched/em_u32.c
+++ b/net/sched/em_u32.c
@@ -12,7 +12,6 @@
12 * Based on net/sched/cls_u32.c 12 * Based on net/sched/cls_u32.c
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/module.h> 15#include <linux/module.h>
17#include <linux/types.h> 16#include <linux/types.h>
18#include <linux/kernel.h> 17#include <linux/kernel.h>
diff --git a/net/sched/ematch.c b/net/sched/ematch.c
index 5cb956b721e8..2405a86093a2 100644
--- a/net/sched/ematch.c
+++ b/net/sched/ematch.c
@@ -81,7 +81,6 @@
81 * open up a beer to watch the compilation going. 81 * open up a beer to watch the compilation going.
82 */ 82 */
83 83
84#include <linux/config.h>
85#include <linux/module.h> 84#include <linux/module.h>
86#include <linux/types.h> 85#include <linux/types.h>
87#include <linux/kernel.h> 86#include <linux/kernel.h>
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 31570b9a6e9a..c7844bacbbcb 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -15,7 +15,6 @@
15 * Jamal Hadi Salim <hadi@nortelnetworks.com>: 990601: ingress support 15 * Jamal Hadi Salim <hadi@nortelnetworks.com>: 990601: ingress support
16 */ 16 */
17 17
18#include <linux/config.h>
19#include <linux/module.h> 18#include <linux/module.h>
20#include <linux/types.h> 19#include <linux/types.h>
21#include <linux/kernel.h> 20#include <linux/kernel.h>
diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c
index ac7cb60d1e25..dbf44da0912f 100644
--- a/net/sched/sch_atm.c
+++ b/net/sched/sch_atm.c
@@ -3,7 +3,6 @@
3/* Written 1998-2000 by Werner Almesberger, EPFL ICA */ 3/* Written 1998-2000 by Werner Almesberger, EPFL ICA */
4 4
5 5
6#include <linux/config.h>
7#include <linux/module.h> 6#include <linux/module.h>
8#include <linux/init.h> 7#include <linux/init.h>
9#include <linux/string.h> 8#include <linux/string.h>
diff --git a/net/sched/sch_blackhole.c b/net/sched/sch_blackhole.c
index 81f0b8346d17..cb0c456aa349 100644
--- a/net/sched/sch_blackhole.c
+++ b/net/sched/sch_blackhole.c
@@ -11,7 +11,6 @@
11 * Note: Quantum tunneling is not supported. 11 * Note: Quantum tunneling is not supported.
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/module.h> 14#include <linux/module.h>
16#include <linux/types.h> 15#include <linux/types.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
index 6cd81708bf71..80b7f6a8d008 100644
--- a/net/sched/sch_cbq.c
+++ b/net/sched/sch_cbq.c
@@ -10,7 +10,6 @@
10 * 10 *
11 */ 11 */
12 12
13#include <linux/config.h>
14#include <linux/module.h> 13#include <linux/module.h>
15#include <asm/uaccess.h> 14#include <asm/uaccess.h>
16#include <asm/system.h> 15#include <asm/system.h>
diff --git a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c
index f6320ca70493..11c8a2119b96 100644
--- a/net/sched/sch_dsmark.c
+++ b/net/sched/sch_dsmark.c
@@ -3,7 +3,6 @@
3/* Written 1998-2000 by Werner Almesberger, EPFL ICA */ 3/* Written 1998-2000 by Werner Almesberger, EPFL ICA */
4 4
5 5
6#include <linux/config.h>
7#include <linux/module.h> 6#include <linux/module.h>
8#include <linux/init.h> 7#include <linux/init.h>
9#include <linux/types.h> 8#include <linux/types.h>
diff --git a/net/sched/sch_fifo.c b/net/sched/sch_fifo.c
index 033083bf0e74..c2689f4ba8de 100644
--- a/net/sched/sch_fifo.c
+++ b/net/sched/sch_fifo.c
@@ -9,7 +9,6 @@
9 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> 9 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/types.h> 13#include <linux/types.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 74d4a1dceeec..d735f51686a1 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -14,7 +14,6 @@
14#include <asm/uaccess.h> 14#include <asm/uaccess.h>
15#include <asm/system.h> 15#include <asm/system.h>
16#include <linux/bitops.h> 16#include <linux/bitops.h>
17#include <linux/config.h>
18#include <linux/module.h> 17#include <linux/module.h>
19#include <linux/types.h> 18#include <linux/types.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c
index 29a2dd9f3029..0cafdd5feb1b 100644
--- a/net/sched/sch_gred.c
+++ b/net/sched/sch_gred.c
@@ -18,7 +18,6 @@
18 * For all the glorious comments look at include/net/red.h 18 * For all the glorious comments look at include/net/red.h
19 */ 19 */
20 20
21#include <linux/config.h>
22#include <linux/module.h> 21#include <linux/module.h>
23#include <linux/types.h> 22#include <linux/types.h>
24#include <linux/kernel.h> 23#include <linux/kernel.h>
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
index f1c7bd29f2cd..6b1b4a981e88 100644
--- a/net/sched/sch_hfsc.c
+++ b/net/sched/sch_hfsc.c
@@ -50,7 +50,6 @@
50 */ 50 */
51 51
52#include <linux/kernel.h> 52#include <linux/kernel.h>
53#include <linux/config.h>
54#include <linux/module.h> 53#include <linux/module.h>
55#include <linux/types.h> 54#include <linux/types.h>
56#include <linux/errno.h> 55#include <linux/errno.h>
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 3ec95df4a85e..34afe41fa2f3 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -27,7 +27,6 @@
27 * 27 *
28 * $Id: sch_htb.c,v 1.25 2003/12/07 11:08:25 devik Exp devik $ 28 * $Id: sch_htb.c,v 1.25 2003/12/07 11:08:25 devik Exp devik $
29 */ 29 */
30#include <linux/config.h>
31#include <linux/module.h> 30#include <linux/module.h>
32#include <asm/uaccess.h> 31#include <asm/uaccess.h>
33#include <asm/system.h> 32#include <asm/system.h>
diff --git a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c
index 8edc32a6ad2f..c3242f727d41 100644
--- a/net/sched/sch_ingress.c
+++ b/net/sched/sch_ingress.c
@@ -7,7 +7,6 @@
7 * Authors: Jamal Hadi Salim 1999 7 * Authors: Jamal Hadi Salim 1999
8 */ 8 */
9 9
10#include <linux/config.h>
11#include <linux/module.h> 10#include <linux/module.h>
12#include <linux/types.h> 11#include <linux/types.h>
13#include <linux/skbuff.h> 12#include <linux/skbuff.h>
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index 5a4a4d0ae502..c5bd8064e6d8 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -13,7 +13,6 @@
13 * Catalin(ux aka Dino) BOIE <catab at umbrella dot ro> 13 * Catalin(ux aka Dino) BOIE <catab at umbrella dot ro>
14 */ 14 */
15 15
16#include <linux/config.h>
17#include <linux/module.h> 16#include <linux/module.h>
18#include <linux/bitops.h> 17#include <linux/bitops.h>
19#include <linux/types.h> 18#include <linux/types.h>
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c
index 3395ca7bcadf..a5fa03c0c19b 100644
--- a/net/sched/sch_prio.c
+++ b/net/sched/sch_prio.c
@@ -11,7 +11,6 @@
11 * Init -- EINVAL when opt undefined 11 * Init -- EINVAL when opt undefined
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/module.h> 14#include <linux/module.h>
16#include <asm/uaccess.h> 15#include <asm/uaccess.h>
17#include <asm/system.h> 16#include <asm/system.h>
diff --git a/net/sched/sch_red.c b/net/sched/sch_red.c
index 2be563cba72b..d65cadddea69 100644
--- a/net/sched/sch_red.c
+++ b/net/sched/sch_red.c
@@ -14,7 +14,6 @@
14 * J Hadi Salim 980816: ECN support 14 * J Hadi Salim 980816: ECN support
15 */ 15 */
16 16
17#include <linux/config.h>
18#include <linux/module.h> 17#include <linux/module.h>
19#include <linux/types.h> 18#include <linux/types.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c
index e057768f68b4..d0d6e595a78c 100644
--- a/net/sched/sch_sfq.c
+++ b/net/sched/sch_sfq.c
@@ -9,7 +9,6 @@
9 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> 9 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <asm/uaccess.h> 13#include <asm/uaccess.h>
15#include <asm/system.h> 14#include <asm/system.h>
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c
index d8e03c74ca76..d9a5d298d755 100644
--- a/net/sched/sch_tbf.c
+++ b/net/sched/sch_tbf.c
@@ -12,7 +12,6 @@
12 * 12 *
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/module.h> 15#include <linux/module.h>
17#include <asm/uaccess.h> 16#include <asm/uaccess.h>
18#include <asm/system.h> 17#include <asm/system.h>
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index b811691c35bf..0a2c71d0d8aa 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -57,7 +57,6 @@
57 * be incorporated into the next SCTP release. 57 * be incorporated into the next SCTP release.
58 */ 58 */
59 59
60#include <linux/config.h>
61#include <linux/types.h> 60#include <linux/types.h>
62#include <linux/kernel.h> 61#include <linux/kernel.h>
63#include <linux/wait.h> 62#include <linux/wait.h>
diff --git a/net/socket.c b/net/socket.c
index 565f5e8d1191..b4848ce0d6ac 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -58,7 +58,6 @@
58 * Based upon Swansea University Computer Society NET3.039 58 * Based upon Swansea University Computer Society NET3.039
59 */ 59 */
60 60
61#include <linux/config.h>
62#include <linux/mm.h> 61#include <linux/mm.h>
63#include <linux/smp_lock.h> 62#include <linux/smp_lock.h>
64#include <linux/socket.h> 63#include <linux/socket.h>
diff --git a/net/sunrpc/auth_gss/gss_mech_switch.c b/net/sunrpc/auth_gss/gss_mech_switch.c
index f8bac6ccd524..d88468d21c37 100644
--- a/net/sunrpc/auth_gss/gss_mech_switch.c
+++ b/net/sunrpc/auth_gss/gss_mech_switch.c
@@ -224,7 +224,8 @@ EXPORT_SYMBOL(gss_service_to_auth_domain_name);
224void 224void
225gss_mech_put(struct gss_api_mech * gm) 225gss_mech_put(struct gss_api_mech * gm)
226{ 226{
227 module_put(gm->gm_owner); 227 if (gm)
228 module_put(gm->gm_owner);
228} 229}
229 230
230EXPORT_SYMBOL(gss_mech_put); 231EXPORT_SYMBOL(gss_mech_put);
@@ -307,8 +308,7 @@ gss_delete_sec_context(struct gss_ctx **context_handle)
307 (*context_handle)->mech_type->gm_ops 308 (*context_handle)->mech_type->gm_ops
308 ->gss_delete_sec_context((*context_handle) 309 ->gss_delete_sec_context((*context_handle)
309 ->internal_ctx_id); 310 ->internal_ctx_id);
310 if ((*context_handle)->mech_type) 311 gss_mech_put((*context_handle)->mech_type);
311 gss_mech_put((*context_handle)->mech_type);
312 kfree(*context_handle); 312 kfree(*context_handle);
313 *context_handle=NULL; 313 *context_handle=NULL;
314 return GSS_S_COMPLETE; 314 return GSS_S_COMPLETE;
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
index d51e316c5821..94217ec9e2dd 100644
--- a/net/sunrpc/auth_gss/svcauth_gss.c
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
@@ -425,6 +425,7 @@ static int rsc_parse(struct cache_detail *cd,
425 struct rsc rsci, *rscp = NULL; 425 struct rsc rsci, *rscp = NULL;
426 time_t expiry; 426 time_t expiry;
427 int status = -EINVAL; 427 int status = -EINVAL;
428 struct gss_api_mech *gm = NULL;
428 429
429 memset(&rsci, 0, sizeof(rsci)); 430 memset(&rsci, 0, sizeof(rsci));
430 /* context handle */ 431 /* context handle */
@@ -453,7 +454,6 @@ static int rsc_parse(struct cache_detail *cd,
453 set_bit(CACHE_NEGATIVE, &rsci.h.flags); 454 set_bit(CACHE_NEGATIVE, &rsci.h.flags);
454 else { 455 else {
455 int N, i; 456 int N, i;
456 struct gss_api_mech *gm;
457 457
458 /* gid */ 458 /* gid */
459 if (get_int(&mesg, &rsci.cred.cr_gid)) 459 if (get_int(&mesg, &rsci.cred.cr_gid))
@@ -488,21 +488,17 @@ static int rsc_parse(struct cache_detail *cd,
488 status = -EINVAL; 488 status = -EINVAL;
489 /* mech-specific data: */ 489 /* mech-specific data: */
490 len = qword_get(&mesg, buf, mlen); 490 len = qword_get(&mesg, buf, mlen);
491 if (len < 0) { 491 if (len < 0)
492 gss_mech_put(gm);
493 goto out; 492 goto out;
494 }
495 status = gss_import_sec_context(buf, len, gm, &rsci.mechctx); 493 status = gss_import_sec_context(buf, len, gm, &rsci.mechctx);
496 if (status) { 494 if (status)
497 gss_mech_put(gm);
498 goto out; 495 goto out;
499 }
500 gss_mech_put(gm);
501 } 496 }
502 rsci.h.expiry_time = expiry; 497 rsci.h.expiry_time = expiry;
503 rscp = rsc_update(&rsci, rscp); 498 rscp = rsc_update(&rsci, rscp);
504 status = 0; 499 status = 0;
505out: 500out:
501 gss_mech_put(gm);
506 rsc_free(&rsci); 502 rsc_free(&rsci);
507 if (rscp) 503 if (rscp)
508 cache_put(&rscp->h, &rsc_cache); 504 cache_put(&rscp->h, &rsc_cache);
@@ -836,6 +832,74 @@ out:
836 return stat; 832 return stat;
837} 833}
838 834
835static inline int
836total_buf_len(struct xdr_buf *buf)
837{
838 return buf->head[0].iov_len + buf->page_len + buf->tail[0].iov_len;
839}
840
841static void
842fix_priv_head(struct xdr_buf *buf, int pad)
843{
844 if (buf->page_len == 0) {
845 /* We need to adjust head and buf->len in tandem in this
846 * case to make svc_defer() work--it finds the original
847 * buffer start using buf->len - buf->head[0].iov_len. */
848 buf->head[0].iov_len -= pad;
849 }
850}
851
852static int
853unwrap_priv_data(struct svc_rqst *rqstp, struct xdr_buf *buf, u32 seq, struct gss_ctx *ctx)
854{
855 u32 priv_len, maj_stat;
856 int pad, saved_len, remaining_len, offset;
857
858 rqstp->rq_sendfile_ok = 0;
859
860 priv_len = ntohl(svc_getu32(&buf->head[0]));
861 if (rqstp->rq_deferred) {
862 /* Already decrypted last time through! The sequence number
863 * check at out_seq is unnecessary but harmless: */
864 goto out_seq;
865 }
866 /* buf->len is the number of bytes from the original start of the
867 * request to the end, where head[0].iov_len is just the bytes
868 * not yet read from the head, so these two values are different: */
869 remaining_len = total_buf_len(buf);
870 if (priv_len > remaining_len)
871 return -EINVAL;
872 pad = remaining_len - priv_len;
873 buf->len -= pad;
874 fix_priv_head(buf, pad);
875
876 /* Maybe it would be better to give gss_unwrap a length parameter: */
877 saved_len = buf->len;
878 buf->len = priv_len;
879 maj_stat = gss_unwrap(ctx, 0, buf);
880 pad = priv_len - buf->len;
881 buf->len = saved_len;
882 buf->len -= pad;
883 /* The upper layers assume the buffer is aligned on 4-byte boundaries.
884 * In the krb5p case, at least, the data ends up offset, so we need to
885 * move it around. */
886 /* XXX: This is very inefficient. It would be better to either do
887 * this while we encrypt, or maybe in the receive code, if we can peak
888 * ahead and work out the service and mechanism there. */
889 offset = buf->head[0].iov_len % 4;
890 if (offset) {
891 buf->buflen = RPCSVC_MAXPAYLOAD;
892 xdr_shift_buf(buf, offset);
893 fix_priv_head(buf, pad);
894 }
895 if (maj_stat != GSS_S_COMPLETE)
896 return -EINVAL;
897out_seq:
898 if (ntohl(svc_getu32(&buf->head[0])) != seq)
899 return -EINVAL;
900 return 0;
901}
902
839struct gss_svc_data { 903struct gss_svc_data {
840 /* decoded gss client cred: */ 904 /* decoded gss client cred: */
841 struct rpc_gss_wire_cred clcred; 905 struct rpc_gss_wire_cred clcred;
@@ -1051,7 +1115,14 @@ svcauth_gss_accept(struct svc_rqst *rqstp, u32 *authp)
1051 svc_putu32(resv, 0); 1115 svc_putu32(resv, 0);
1052 break; 1116 break;
1053 case RPC_GSS_SVC_PRIVACY: 1117 case RPC_GSS_SVC_PRIVACY:
1054 /* currently unsupported */ 1118 if (unwrap_priv_data(rqstp, &rqstp->rq_arg,
1119 gc->gc_seq, rsci->mechctx))
1120 goto auth_err;
1121 /* placeholders for length and seq. number: */
1122 svcdata->body_start = resv->iov_base + resv->iov_len;
1123 svc_putu32(resv, 0);
1124 svc_putu32(resv, 0);
1125 break;
1055 default: 1126 default:
1056 goto auth_err; 1127 goto auth_err;
1057 } 1128 }
@@ -1076,8 +1147,8 @@ out:
1076 return ret; 1147 return ret;
1077} 1148}
1078 1149
1079static int 1150static inline int
1080svcauth_gss_release(struct svc_rqst *rqstp) 1151svcauth_gss_wrap_resp_integ(struct svc_rqst *rqstp)
1081{ 1152{
1082 struct gss_svc_data *gsd = (struct gss_svc_data *)rqstp->rq_auth_data; 1153 struct gss_svc_data *gsd = (struct gss_svc_data *)rqstp->rq_auth_data;
1083 struct rpc_gss_wire_cred *gc = &gsd->clcred; 1154 struct rpc_gss_wire_cred *gc = &gsd->clcred;
@@ -1089,69 +1160,147 @@ svcauth_gss_release(struct svc_rqst *rqstp)
1089 int integ_offset, integ_len; 1160 int integ_offset, integ_len;
1090 int stat = -EINVAL; 1161 int stat = -EINVAL;
1091 1162
1163 p = gsd->body_start;
1164 gsd->body_start = NULL;
1165 /* move accept_stat to right place: */
1166 memcpy(p, p + 2, 4);
1167 /* Don't wrap in failure case: */
1168 /* Counting on not getting here if call was not even accepted! */
1169 if (*p != rpc_success) {
1170 resbuf->head[0].iov_len -= 2 * 4;
1171 goto out;
1172 }
1173 p++;
1174 integ_offset = (u8 *)(p + 1) - (u8 *)resbuf->head[0].iov_base;
1175 integ_len = resbuf->len - integ_offset;
1176 BUG_ON(integ_len % 4);
1177 *p++ = htonl(integ_len);
1178 *p++ = htonl(gc->gc_seq);
1179 if (xdr_buf_subsegment(resbuf, &integ_buf, integ_offset,
1180 integ_len))
1181 BUG();
1182 if (resbuf->page_len == 0
1183 && resbuf->head[0].iov_len + RPC_MAX_AUTH_SIZE
1184 < PAGE_SIZE) {
1185 BUG_ON(resbuf->tail[0].iov_len);
1186 /* Use head for everything */
1187 resv = &resbuf->head[0];
1188 } else if (resbuf->tail[0].iov_base == NULL) {
1189 if (resbuf->head[0].iov_len + RPC_MAX_AUTH_SIZE > PAGE_SIZE)
1190 goto out_err;
1191 resbuf->tail[0].iov_base = resbuf->head[0].iov_base
1192 + resbuf->head[0].iov_len;
1193 resbuf->tail[0].iov_len = 0;
1194 rqstp->rq_restailpage = 0;
1195 resv = &resbuf->tail[0];
1196 } else {
1197 resv = &resbuf->tail[0];
1198 }
1199 mic.data = (u8 *)resv->iov_base + resv->iov_len + 4;
1200 if (gss_get_mic(gsd->rsci->mechctx, &integ_buf, &mic))
1201 goto out_err;
1202 svc_putu32(resv, htonl(mic.len));
1203 memset(mic.data + mic.len, 0,
1204 round_up_to_quad(mic.len) - mic.len);
1205 resv->iov_len += XDR_QUADLEN(mic.len) << 2;
1206 /* not strictly required: */
1207 resbuf->len += XDR_QUADLEN(mic.len) << 2;
1208 BUG_ON(resv->iov_len > PAGE_SIZE);
1209out:
1210 stat = 0;
1211out_err:
1212 return stat;
1213}
1214
1215static inline int
1216svcauth_gss_wrap_resp_priv(struct svc_rqst *rqstp)
1217{
1218 struct gss_svc_data *gsd = (struct gss_svc_data *)rqstp->rq_auth_data;
1219 struct rpc_gss_wire_cred *gc = &gsd->clcred;
1220 struct xdr_buf *resbuf = &rqstp->rq_res;
1221 struct page **inpages = NULL;
1222 u32 *p;
1223 int offset, *len;
1224 int pad;
1225
1226 p = gsd->body_start;
1227 gsd->body_start = NULL;
1228 /* move accept_stat to right place: */
1229 memcpy(p, p + 2, 4);
1230 /* Don't wrap in failure case: */
1231 /* Counting on not getting here if call was not even accepted! */
1232 if (*p != rpc_success) {
1233 resbuf->head[0].iov_len -= 2 * 4;
1234 return 0;
1235 }
1236 p++;
1237 len = p++;
1238 offset = (u8 *)p - (u8 *)resbuf->head[0].iov_base;
1239 *p++ = htonl(gc->gc_seq);
1240 inpages = resbuf->pages;
1241 /* XXX: Would be better to write some xdr helper functions for
1242 * nfs{2,3,4}xdr.c that place the data right, instead of copying: */
1243 if (resbuf->tail[0].iov_base && rqstp->rq_restailpage == 0) {
1244 BUG_ON(resbuf->tail[0].iov_base >= resbuf->head[0].iov_base
1245 + PAGE_SIZE);
1246 BUG_ON(resbuf->tail[0].iov_base < resbuf->head[0].iov_base);
1247 if (resbuf->tail[0].iov_len + resbuf->head[0].iov_len
1248 + 2 * RPC_MAX_AUTH_SIZE > PAGE_SIZE)
1249 return -ENOMEM;
1250 memmove(resbuf->tail[0].iov_base + RPC_MAX_AUTH_SIZE,
1251 resbuf->tail[0].iov_base,
1252 resbuf->tail[0].iov_len);
1253 resbuf->tail[0].iov_base += RPC_MAX_AUTH_SIZE;
1254 }
1255 if (resbuf->tail[0].iov_base == NULL) {
1256 if (resbuf->head[0].iov_len + 2*RPC_MAX_AUTH_SIZE > PAGE_SIZE)
1257 return -ENOMEM;
1258 resbuf->tail[0].iov_base = resbuf->head[0].iov_base
1259 + resbuf->head[0].iov_len + RPC_MAX_AUTH_SIZE;
1260 resbuf->tail[0].iov_len = 0;
1261 rqstp->rq_restailpage = 0;
1262 }
1263 if (gss_wrap(gsd->rsci->mechctx, offset, resbuf, inpages))
1264 return -ENOMEM;
1265 *len = htonl(resbuf->len - offset);
1266 pad = 3 - ((resbuf->len - offset - 1)&3);
1267 p = (u32 *)(resbuf->tail[0].iov_base + resbuf->tail[0].iov_len);
1268 memset(p, 0, pad);
1269 resbuf->tail[0].iov_len += pad;
1270 resbuf->len += pad;
1271 return 0;
1272}
1273
1274static int
1275svcauth_gss_release(struct svc_rqst *rqstp)
1276{
1277 struct gss_svc_data *gsd = (struct gss_svc_data *)rqstp->rq_auth_data;
1278 struct rpc_gss_wire_cred *gc = &gsd->clcred;
1279 struct xdr_buf *resbuf = &rqstp->rq_res;
1280 int stat = -EINVAL;
1281
1092 if (gc->gc_proc != RPC_GSS_PROC_DATA) 1282 if (gc->gc_proc != RPC_GSS_PROC_DATA)
1093 goto out; 1283 goto out;
1094 /* Release can be called twice, but we only wrap once. */ 1284 /* Release can be called twice, but we only wrap once. */
1095 if (gsd->body_start == NULL) 1285 if (gsd->body_start == NULL)
1096 goto out; 1286 goto out;
1097 /* normally not set till svc_send, but we need it here: */ 1287 /* normally not set till svc_send, but we need it here: */
1098 resbuf->len = resbuf->head[0].iov_len 1288 /* XXX: what for? Do we mess it up the moment we call svc_putu32
1099 + resbuf->page_len + resbuf->tail[0].iov_len; 1289 * or whatever? */
1290 resbuf->len = total_buf_len(resbuf);
1100 switch (gc->gc_svc) { 1291 switch (gc->gc_svc) {
1101 case RPC_GSS_SVC_NONE: 1292 case RPC_GSS_SVC_NONE:
1102 break; 1293 break;
1103 case RPC_GSS_SVC_INTEGRITY: 1294 case RPC_GSS_SVC_INTEGRITY:
1104 p = gsd->body_start; 1295 stat = svcauth_gss_wrap_resp_integ(rqstp);
1105 gsd->body_start = NULL; 1296 if (stat)
1106 /* move accept_stat to right place: */
1107 memcpy(p, p + 2, 4);
1108 /* don't wrap in failure case: */
1109 /* Note: counting on not getting here if call was not even
1110 * accepted! */
1111 if (*p != rpc_success) {
1112 resbuf->head[0].iov_len -= 2 * 4;
1113 goto out;
1114 }
1115 p++;
1116 integ_offset = (u8 *)(p + 1) - (u8 *)resbuf->head[0].iov_base;
1117 integ_len = resbuf->len - integ_offset;
1118 BUG_ON(integ_len % 4);
1119 *p++ = htonl(integ_len);
1120 *p++ = htonl(gc->gc_seq);
1121 if (xdr_buf_subsegment(resbuf, &integ_buf, integ_offset,
1122 integ_len))
1123 BUG();
1124 if (resbuf->page_len == 0
1125 && resbuf->head[0].iov_len + RPC_MAX_AUTH_SIZE
1126 < PAGE_SIZE) {
1127 BUG_ON(resbuf->tail[0].iov_len);
1128 /* Use head for everything */
1129 resv = &resbuf->head[0];
1130 } else if (resbuf->tail[0].iov_base == NULL) {
1131 if (resbuf->head[0].iov_len + RPC_MAX_AUTH_SIZE
1132 > PAGE_SIZE)
1133 goto out_err;
1134 resbuf->tail[0].iov_base =
1135 resbuf->head[0].iov_base
1136 + resbuf->head[0].iov_len;
1137 resbuf->tail[0].iov_len = 0;
1138 rqstp->rq_restailpage = 0;
1139 resv = &resbuf->tail[0];
1140 } else {
1141 resv = &resbuf->tail[0];
1142 }
1143 mic.data = (u8 *)resv->iov_base + resv->iov_len + 4;
1144 if (gss_get_mic(gsd->rsci->mechctx, &integ_buf, &mic))
1145 goto out_err; 1297 goto out_err;
1146 svc_putu32(resv, htonl(mic.len));
1147 memset(mic.data + mic.len, 0,
1148 round_up_to_quad(mic.len) - mic.len);
1149 resv->iov_len += XDR_QUADLEN(mic.len) << 2;
1150 /* not strictly required: */
1151 resbuf->len += XDR_QUADLEN(mic.len) << 2;
1152 BUG_ON(resv->iov_len > PAGE_SIZE);
1153 break; 1298 break;
1154 case RPC_GSS_SVC_PRIVACY: 1299 case RPC_GSS_SVC_PRIVACY:
1300 stat = svcauth_gss_wrap_resp_priv(rqstp);
1301 if (stat)
1302 goto out_err;
1303 break;
1155 default: 1304 default:
1156 goto out_err; 1305 goto out_err;
1157 } 1306 }
diff --git a/net/sunrpc/pmap_clnt.c b/net/sunrpc/pmap_clnt.c
index d25b054ec921..623180f224c9 100644
--- a/net/sunrpc/pmap_clnt.c
+++ b/net/sunrpc/pmap_clnt.c
@@ -6,7 +6,6 @@
6 * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de> 6 * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/types.h> 9#include <linux/types.h>
11#include <linux/socket.h> 10#include <linux/socket.h>
12#include <linux/kernel.h> 11#include <linux/kernel.h>
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index dafe793c774e..6db6006616c6 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -8,7 +8,6 @@
8 * Copyright (c) 2002, Trond Myklebust <trond.myklebust@fys.uio.no> 8 * Copyright (c) 2002, Trond Myklebust <trond.myklebust@fys.uio.no>
9 * 9 *
10 */ 10 */
11#include <linux/config.h>
12#include <linux/module.h> 11#include <linux/module.h>
13#include <linux/slab.h> 12#include <linux/slab.h>
14#include <linux/string.h> 13#include <linux/string.h>
diff --git a/net/sunrpc/sunrpc_syms.c b/net/sunrpc/sunrpc_syms.c
index 769114f0f886..f38f939ce95f 100644
--- a/net/sunrpc/sunrpc_syms.c
+++ b/net/sunrpc/sunrpc_syms.c
@@ -6,7 +6,6 @@
6 * Copyright (C) 1997 Olaf Kirch <okir@monad.swb.de> 6 * Copyright (C) 1997 Olaf Kirch <okir@monad.swb.de>
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/module.h> 9#include <linux/module.h>
11 10
12#include <linux/types.h> 11#include <linux/types.h>
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index b08419e1fc68..01ba60a49572 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -280,7 +280,10 @@ svc_process(struct svc_serv *serv, struct svc_rqst *rqstp)
280 rqstp->rq_res.page_base = 0; 280 rqstp->rq_res.page_base = 0;
281 rqstp->rq_res.page_len = 0; 281 rqstp->rq_res.page_len = 0;
282 rqstp->rq_res.buflen = PAGE_SIZE; 282 rqstp->rq_res.buflen = PAGE_SIZE;
283 rqstp->rq_res.tail[0].iov_base = NULL;
283 rqstp->rq_res.tail[0].iov_len = 0; 284 rqstp->rq_res.tail[0].iov_len = 0;
285 /* Will be turned off only in gss privacy case: */
286 rqstp->rq_sendfile_ok = 1;
284 /* tcp needs a space for the record length... */ 287 /* tcp needs a space for the record length... */
285 if (rqstp->rq_prot == IPPROTO_TCP) 288 if (rqstp->rq_prot == IPPROTO_TCP)
286 svc_putu32(resv, 0); 289 svc_putu32(resv, 0);
diff --git a/net/sunrpc/sysctl.c b/net/sunrpc/sysctl.c
index 1065904841fd..d89b048ad6bb 100644
--- a/net/sunrpc/sysctl.c
+++ b/net/sunrpc/sysctl.c
@@ -7,7 +7,6 @@
7 * impossible at the moment. 7 * impossible at the moment.
8 */ 8 */
9 9
10#include <linux/config.h>
11#include <linux/types.h> 10#include <linux/types.h>
12#include <linux/linkage.h> 11#include <linux/linkage.h>
13#include <linux/ctype.h> 12#include <linux/ctype.h>
diff --git a/net/sysctl_net.c b/net/sysctl_net.c
index 58a1b6b42ddd..cd4eafbab1b8 100644
--- a/net/sysctl_net.c
+++ b/net/sysctl_net.c
@@ -12,7 +12,6 @@
12 * 12 *
13 */ 13 */
14 14
15#include <linux/config.h>
16#include <linux/mm.h> 15#include <linux/mm.h>
17#include <linux/sysctl.h> 16#include <linux/sysctl.h>
18 17
diff --git a/net/tipc/core.c b/net/tipc/core.c
index 5003acb15919..0539a8362858 100644
--- a/net/tipc/core.c
+++ b/net/tipc/core.c
@@ -191,7 +191,8 @@ static int __init tipc_init(void)
191 int res; 191 int res;
192 192
193 tipc_log_reinit(CONFIG_TIPC_LOG); 193 tipc_log_reinit(CONFIG_TIPC_LOG);
194 info("Activated (compiled " __DATE__ " " __TIME__ ")\n"); 194 info("Activated (version " TIPC_MOD_VER
195 " compiled " __DATE__ " " __TIME__ ")\n");
195 196
196 tipc_own_addr = 0; 197 tipc_own_addr = 0;
197 tipc_remote_management = 1; 198 tipc_remote_management = 1;
diff --git a/net/tipc/link.c b/net/tipc/link.c
index d64658053746..c6831c75cfa4 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -2,7 +2,7 @@
2 * net/tipc/link.c: TIPC link code 2 * net/tipc/link.c: TIPC link code
3 * 3 *
4 * Copyright (c) 1996-2006, Ericsson AB 4 * Copyright (c) 1996-2006, Ericsson AB
5 * Copyright (c) 2004-2005, Wind River Systems 5 * Copyright (c) 2004-2006, Wind River Systems
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
@@ -988,17 +988,18 @@ static int link_bundle_buf(struct link *l_ptr,
988 struct tipc_msg *bundler_msg = buf_msg(bundler); 988 struct tipc_msg *bundler_msg = buf_msg(bundler);
989 struct tipc_msg *msg = buf_msg(buf); 989 struct tipc_msg *msg = buf_msg(buf);
990 u32 size = msg_size(msg); 990 u32 size = msg_size(msg);
991 u32 to_pos = align(msg_size(bundler_msg)); 991 u32 bundle_size = msg_size(bundler_msg);
992 u32 rest = link_max_pkt(l_ptr) - to_pos; 992 u32 to_pos = align(bundle_size);
993 u32 pad = to_pos - bundle_size;
993 994
994 if (msg_user(bundler_msg) != MSG_BUNDLER) 995 if (msg_user(bundler_msg) != MSG_BUNDLER)
995 return 0; 996 return 0;
996 if (msg_type(bundler_msg) != OPEN_MSG) 997 if (msg_type(bundler_msg) != OPEN_MSG)
997 return 0; 998 return 0;
998 if (rest < align(size)) 999 if (skb_tailroom(bundler) < (pad + size))
999 return 0; 1000 return 0;
1000 1001
1001 skb_put(bundler, (to_pos - msg_size(bundler_msg)) + size); 1002 skb_put(bundler, pad + size);
1002 memcpy(bundler->data + to_pos, buf->data, size); 1003 memcpy(bundler->data + to_pos, buf->data, size);
1003 msg_set_size(bundler_msg, to_pos + size); 1004 msg_set_size(bundler_msg, to_pos + size);
1004 msg_set_msgcnt(bundler_msg, msg_msgcnt(bundler_msg) + 1); 1005 msg_set_msgcnt(bundler_msg, msg_msgcnt(bundler_msg) + 1);
diff --git a/net/tipc/node.c b/net/tipc/node.c
index 861322b935da..fc6d09630ccd 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -2,7 +2,7 @@
2 * net/tipc/node.c: TIPC node management routines 2 * net/tipc/node.c: TIPC node management routines
3 * 3 *
4 * Copyright (c) 2000-2006, Ericsson AB 4 * Copyright (c) 2000-2006, Ericsson AB
5 * Copyright (c) 2005, Wind River Systems 5 * Copyright (c) 2005-2006, Wind River Systems
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
@@ -592,6 +592,7 @@ struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space)
592 struct sk_buff *buf; 592 struct sk_buff *buf;
593 struct node *n_ptr; 593 struct node *n_ptr;
594 struct tipc_node_info node_info; 594 struct tipc_node_info node_info;
595 u32 payload_size;
595 596
596 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_NET_ADDR)) 597 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_NET_ADDR))
597 return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR); 598 return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
@@ -608,8 +609,11 @@ struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space)
608 /* For now, get space for all other nodes 609 /* For now, get space for all other nodes
609 (will need to modify this when slave nodes are supported */ 610 (will need to modify this when slave nodes are supported */
610 611
611 buf = tipc_cfg_reply_alloc(TLV_SPACE(sizeof(node_info)) * 612 payload_size = TLV_SPACE(sizeof(node_info)) * (tipc_max_nodes - 1);
612 (tipc_max_nodes - 1)); 613 if (payload_size > 32768u)
614 return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
615 " (too many nodes)");
616 buf = tipc_cfg_reply_alloc(payload_size);
613 if (!buf) 617 if (!buf)
614 return NULL; 618 return NULL;
615 619
@@ -633,6 +637,7 @@ struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space)
633 struct sk_buff *buf; 637 struct sk_buff *buf;
634 struct node *n_ptr; 638 struct node *n_ptr;
635 struct tipc_link_info link_info; 639 struct tipc_link_info link_info;
640 u32 payload_size;
636 641
637 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_NET_ADDR)) 642 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_NET_ADDR))
638 return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR); 643 return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
@@ -645,12 +650,15 @@ struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space)
645 650
646 if (!tipc_nodes) 651 if (!tipc_nodes)
647 return tipc_cfg_reply_none(); 652 return tipc_cfg_reply_none();
648 653
649 /* For now, get space for 2 links to all other nodes + bcast link 654 /* Get space for all unicast links + multicast link */
650 (will need to modify this when slave nodes are supported */ 655
651 656 payload_size = TLV_SPACE(sizeof(link_info)) *
652 buf = tipc_cfg_reply_alloc(TLV_SPACE(sizeof(link_info)) * 657 (tipc_net.zones[tipc_zone(tipc_own_addr)]->links + 1);
653 (2 * (tipc_max_nodes - 1) + 1)); 658 if (payload_size > 32768u)
659 return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
660 " (too many links)");
661 buf = tipc_cfg_reply_alloc(payload_size);
654 if (!buf) 662 if (!buf)
655 return NULL; 663 return NULL;
656 664
diff --git a/net/tipc/zone.h b/net/tipc/zone.h
index 267999c5a240..5ab3d08602e2 100644
--- a/net/tipc/zone.h
+++ b/net/tipc/zone.h
@@ -2,7 +2,7 @@
2 * net/tipc/zone.h: Include file for TIPC zone management routines 2 * net/tipc/zone.h: Include file for TIPC zone management routines
3 * 3 *
4 * Copyright (c) 2000-2006, Ericsson AB 4 * Copyright (c) 2000-2006, Ericsson AB
5 * Copyright (c) 2005, Wind River Systems 5 * Copyright (c) 2005-2006, Wind River Systems
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
@@ -45,7 +45,7 @@
45 * struct _zone - TIPC zone structure 45 * struct _zone - TIPC zone structure
46 * @addr: network address of zone 46 * @addr: network address of zone
47 * @clusters: array of pointers to all clusters within zone 47 * @clusters: array of pointers to all clusters within zone
48 * @links: (used for inter-zone communication) 48 * @links: number of (unicast) links to zone
49 */ 49 */
50 50
51struct _zone { 51struct _zone {
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index d901465ce013..aca650109425 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -83,7 +83,6 @@
83 */ 83 */
84 84
85#include <linux/module.h> 85#include <linux/module.h>
86#include <linux/config.h>
87#include <linux/kernel.h> 86#include <linux/kernel.h>
88#include <linux/signal.h> 87#include <linux/signal.h>
89#include <linux/sched.h> 88#include <linux/sched.h>
@@ -128,6 +127,30 @@ static atomic_t unix_nr_socks = ATOMIC_INIT(0);
128 127
129#define UNIX_ABSTRACT(sk) (unix_sk(sk)->addr->hash != UNIX_HASH_SIZE) 128#define UNIX_ABSTRACT(sk) (unix_sk(sk)->addr->hash != UNIX_HASH_SIZE)
130 129
130#ifdef CONFIG_SECURITY_NETWORK
131static void unix_get_peersec_dgram(struct sk_buff *skb)
132{
133 int err;
134
135 err = security_socket_getpeersec_dgram(skb, UNIXSECDATA(skb),
136 UNIXSECLEN(skb));
137 if (err)
138 *(UNIXSECDATA(skb)) = NULL;
139}
140
141static inline void unix_set_secdata(struct scm_cookie *scm, struct sk_buff *skb)
142{
143 scm->secdata = *UNIXSECDATA(skb);
144 scm->seclen = *UNIXSECLEN(skb);
145}
146#else
147static void unix_get_peersec_dgram(struct sk_buff *skb)
148{ }
149
150static inline void unix_set_secdata(struct scm_cookie *scm, struct sk_buff *skb)
151{ }
152#endif /* CONFIG_SECURITY_NETWORK */
153
131/* 154/*
132 * SMP locking strategy: 155 * SMP locking strategy:
133 * hash table is protected with spinlock unix_table_lock 156 * hash table is protected with spinlock unix_table_lock
@@ -1291,6 +1314,8 @@ static int unix_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock,
1291 if (siocb->scm->fp) 1314 if (siocb->scm->fp)
1292 unix_attach_fds(siocb->scm, skb); 1315 unix_attach_fds(siocb->scm, skb);
1293 1316
1317 unix_get_peersec_dgram(skb);
1318
1294 skb->h.raw = skb->data; 1319 skb->h.raw = skb->data;
1295 err = memcpy_fromiovec(skb_put(skb,len), msg->msg_iov, len); 1320 err = memcpy_fromiovec(skb_put(skb,len), msg->msg_iov, len);
1296 if (err) 1321 if (err)
@@ -1570,6 +1595,7 @@ static int unix_dgram_recvmsg(struct kiocb *iocb, struct socket *sock,
1570 memset(&tmp_scm, 0, sizeof(tmp_scm)); 1595 memset(&tmp_scm, 0, sizeof(tmp_scm));
1571 } 1596 }
1572 siocb->scm->creds = *UNIXCREDS(skb); 1597 siocb->scm->creds = *UNIXCREDS(skb);
1598 unix_set_secdata(siocb->scm, skb);
1573 1599
1574 if (!(flags & MSG_PEEK)) 1600 if (!(flags & MSG_PEEK))
1575 { 1601 {
diff --git a/net/wanrouter/af_wanpipe.c b/net/wanrouter/af_wanpipe.c
index b1265187b4a8..a690cf773b6a 100644
--- a/net/wanrouter/af_wanpipe.c
+++ b/net/wanrouter/af_wanpipe.c
@@ -32,7 +32,6 @@
32* 32*
33******************************************************************************/ 33******************************************************************************/
34 34
35#include <linux/config.h>
36#include <linux/types.h> 35#include <linux/types.h>
37#include <linux/sched.h> 36#include <linux/sched.h>
38#include <linux/mm.h> 37#include <linux/mm.h>
diff --git a/net/wanrouter/wanmain.c b/net/wanrouter/wanmain.c
index c34833dc7cc1..ad8e8a797790 100644
--- a/net/wanrouter/wanmain.c
+++ b/net/wanrouter/wanmain.c
@@ -42,7 +42,6 @@
42* Jun 02, 1999 Gideon Hack Updates for Linux 2.0.X and 2.2.X kernels. 42* Jun 02, 1999 Gideon Hack Updates for Linux 2.0.X and 2.2.X kernels.
43*****************************************************************************/ 43*****************************************************************************/
44 44
45#include <linux/config.h>
46#include <linux/stddef.h> /* offsetof(), etc. */ 45#include <linux/stddef.h> /* offsetof(), etc. */
47#include <linux/capability.h> 46#include <linux/capability.h>
48#include <linux/errno.h> /* return codes */ 47#include <linux/errno.h> /* return codes */
diff --git a/net/wanrouter/wanproc.c b/net/wanrouter/wanproc.c
index c28ba5a47209..930ea59463ad 100644
--- a/net/wanrouter/wanproc.c
+++ b/net/wanrouter/wanproc.c
@@ -20,7 +20,6 @@
20* Dec 13, 1996 Gene Kozin Initial version (based on Sangoma's WANPIPE) 20* Dec 13, 1996 Gene Kozin Initial version (based on Sangoma's WANPIPE)
21*****************************************************************************/ 21*****************************************************************************/
22 22
23#include <linux/config.h>
24#include <linux/init.h> /* __initfunc et al. */ 23#include <linux/init.h> /* __initfunc et al. */
25#include <linux/stddef.h> /* offsetof(), etc. */ 24#include <linux/stddef.h> /* offsetof(), etc. */
26#include <linux/errno.h> /* return codes */ 25#include <linux/errno.h> /* return codes */
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index 282ce4e40d7b..52a2726d327f 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -35,7 +35,6 @@
35 * response 35 * response
36 */ 36 */
37 37
38#include <linux/config.h>
39#include <linux/module.h> 38#include <linux/module.h>
40#include <linux/capability.h> 39#include <linux/capability.h>
41#include <linux/errno.h> 40#include <linux/errno.h>
diff --git a/net/x25/x25_dev.c b/net/x25/x25_dev.c
index adfe7b8df355..47b68a301677 100644
--- a/net/x25/x25_dev.c
+++ b/net/x25/x25_dev.c
@@ -17,7 +17,6 @@
17 * 2000-09-04 Henner Eisen Prevent freeing a dangling skb. 17 * 2000-09-04 Henner Eisen Prevent freeing a dangling skb.
18 */ 18 */
19 19
20#include <linux/config.h>
21#include <linux/kernel.h> 20#include <linux/kernel.h>
22#include <linux/netdevice.h> 21#include <linux/netdevice.h>
23#include <linux/skbuff.h> 22#include <linux/skbuff.h>
diff --git a/net/x25/x25_proc.c b/net/x25/x25_proc.c
index dfb80116c59f..a11837d361d2 100644
--- a/net/x25/x25_proc.c
+++ b/net/x25/x25_proc.c
@@ -17,7 +17,6 @@
17 * 2002/10/06 Arnaldo Carvalho de Melo seq_file support 17 * 2002/10/06 Arnaldo Carvalho de Melo seq_file support
18 */ 18 */
19 19
20#include <linux/config.h>
21#include <linux/init.h> 20#include <linux/init.h>
22#include <linux/proc_fs.h> 21#include <linux/proc_fs.h>
23#include <linux/seq_file.h> 22#include <linux/seq_file.h>
diff --git a/net/x25/x25_route.c b/net/x25/x25_route.c
index 6c5d37517035..2a3fe986b245 100644
--- a/net/x25/x25_route.c
+++ b/net/x25/x25_route.c
@@ -17,7 +17,6 @@
17 * X.25 001 Jonathan Naylor Started coding. 17 * X.25 001 Jonathan Naylor Started coding.
18 */ 18 */
19 19
20#include <linux/config.h>
21#include <linux/if_arp.h> 20#include <linux/if_arp.h>
22#include <linux/init.h> 21#include <linux/init.h>
23#include <net/x25.h> 22#include <net/x25.h>
diff --git a/net/xfrm/xfrm_algo.c b/net/xfrm/xfrm_algo.c
index 6ed3302312fb..04e1aea58bc9 100644
--- a/net/xfrm/xfrm_algo.c
+++ b/net/xfrm/xfrm_algo.c
@@ -9,7 +9,6 @@
9 * any later version. 9 * any later version.
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/kernel.h> 13#include <linux/kernel.h>
15#include <linux/pfkeyv2.h> 14#include <linux/pfkeyv2.h>
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index b8936926c24b..405b741dff43 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -13,7 +13,6 @@
13 * 13 *
14 */ 14 */
15 15
16#include <linux/config.h>
17#include <linux/slab.h> 16#include <linux/slab.h>
18#include <linux/kmod.h> 17#include <linux/kmod.h>
19#include <linux/list.h> 18#include <linux/list.h>
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 17b29ec3c417..43f00fc28a3d 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -1164,8 +1164,6 @@ int xfrm_state_mtu(struct xfrm_state *x, int mtu)
1164 return res; 1164 return res;
1165} 1165}
1166 1166
1167EXPORT_SYMBOL(xfrm_state_mtu);
1168
1169int xfrm_init_state(struct xfrm_state *x) 1167int xfrm_init_state(struct xfrm_state *x)
1170{ 1168{
1171 struct xfrm_state_afinfo *afinfo; 1169 struct xfrm_state_afinfo *afinfo;
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index c21dc26141ea..3e6a722d072e 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -1435,7 +1435,7 @@ static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, int *err
1435 link = &xfrm_dispatch[type]; 1435 link = &xfrm_dispatch[type];
1436 1436
1437 /* All operations require privileges, even GET */ 1437 /* All operations require privileges, even GET */
1438 if (security_netlink_recv(skb)) { 1438 if (security_netlink_recv(skb, CAP_NET_ADMIN)) {
1439 *errp = -EPERM; 1439 *errp = -EPERM;
1440 return -1; 1440 return -1;
1441 } 1441 }