network - Move socket from netmsg ext to netmsg header, add port to socket
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 5 Dec 2009 19:45:34 +0000 (11:45 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 5 Dec 2009 19:45:34 +0000 (11:45 -0800)
commit48e7b118aed5eb70d42bdbf2ca5a938ef1f371b6
tree6207a2c3ea3ed617eae429bd22a4147bb36841ce
parent2fb40d7c8679dfe2800b6e0f95d7014c2f820306
network - Move socket from netmsg ext to netmsg header, add port to socket

These changes should make it easier to debug mbufs routed to the wrong
protocol threads.  Note that IPV6 is routed to netisr0, even for tcp and udp
packets, so for now we do not KKASSERT that the port matches directly.

The TCP code still KKASSERTs that the timers are running on the correct cpu,
since the cpu is still correct for IPV6 TCP/UDP packets even when the
protocol thread is wrong (netisr_cpu 0 instead of tcp_thread 0 or
udp_thread 0).

* Instead of recalculating the port based on the inp or mbuf all the time,
  add a so_port field to the socket structure directly.

* The socket pointer is now part of the netmsg header, even though some
  subsystems do not need it.  This allows us to validate the message port
  more easily.
49 files changed:
sys/dev/acpica5/acpi_cpu_pstate.c
sys/dev/netif/iwl/if_iwl.c
sys/kern/kern_poll.c
sys/kern/kern_timeout.c
sys/kern/uipc_msg.c
sys/kern/uipc_socket.c
sys/kern/uipc_socket2.c
sys/kern/uipc_syscalls.c
sys/kern/uipc_usrreq.c
sys/net/bpf.c
sys/net/bridge/if_bridge.c
sys/net/dummynet/ip_dummynet.c
sys/net/dummynet/ip_dummynet_glue.c
sys/net/if.c
sys/net/if_ethersubr.c
sys/net/if_poll.c
sys/net/ipfw/ip_fw2.c
sys/net/ipfw/ip_fw2_glue.c
sys/net/netisr.c
sys/net/netmsg.h
sys/net/netmsg2.h
sys/net/pf/pf.c
sys/net/pfil.c
sys/net/route.c
sys/net/rtsock.c
sys/net/vlan/if_vlan.c
sys/netinet/if_ether.c
sys/netinet/in.c
sys/netinet/ip_demux.c
sys/netinet/ip_divert.c
sys/netinet/ip_divert.h
sys/netinet/ip_flow.c
sys/netinet/ip_input.c
sys/netinet/ip_var.h
sys/netinet/tcp_subr.c
sys/netinet/tcp_syncache.c
sys/netinet/tcp_timer.c
sys/netinet/tcp_usrreq.c
sys/netinet/tcp_var.h
sys/netinet/udp_usrreq.c
sys/netinet/udp_var.h
sys/netinet6/ip6_demux.c
sys/netinet6/ip6protosw.h
sys/netinet6/tcp6_var.h
sys/netinet6/udp6_usrreq.c
sys/netproto/atm/atm_proto.c
sys/sys/protosw.h
sys/sys/socketops.h
sys/sys/socketvar.h