freebsd-skq/sys/netinet
rwatson f00509ea8d Until this change, the UDP input code used global variables udp_in,
udp_in6, and udp_ip6 to pass socket address state between udp_input(),
udp_append(), and soappendaddr_locked().  While file in the default
configuration, when running with multiple netisrs or direct ithread
dispatch, this can result in races wherein user processes using
recvmsg() get back the wrong source IP/port.  To correct this and
related races:

- Eliminate udp_ip6, which is believed to be generated but then never
  used.  Eliminate ip_2_ip6_hdr() as it is now unneeded.

- Eliminate setting, testing, and existence of 'init' status fields
  for the IPv6 structures.  While with multiple UDP delivery this
  could lead to amortization of IPv4 -> IPv6 conversion when
  delivering an IPv4 UDP packet to an IPv6 socket, it added
  substantial complexity and side effects.

- Move global structures into the stack, declaring udp_in in
  udp_input(), and udp_in6 in udp_append() to be used if a conversion
  is required.  Pass &udp_in into udp_append().

- Re-annotate comments to reflect updates.

With this change, UDP appears to operate correctly in the presence of
substantial inbound processing parallelism.  This solution avoids
introducing additional synchronization, but does increase the
potential stack depth.

Discovered by:	kris (Bug Magnet)
MFC after:	3 weeks
2004-11-04 01:25:23 +00:00
..
libalias For variables that are only checked with defined(), don't provide 2004-10-24 15:33:08 +00:00
accf_data.c add missing #include <sys/module.h> 2004-05-30 20:27:19 +00:00
accf_http.c The socket field so_state is used to hold a variety of socket related 2004-06-14 18:16:22 +00:00
icmp6.h Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
icmp_var.h White space cleanup for netinet before branch: 2004-08-16 18:32:07 +00:00
if_atm.c White space cleanup for netinet before branch: 2004-08-16 18:32:07 +00:00
if_atm.h White space cleanup for netinet before branch: 2004-08-16 18:32:07 +00:00
if_ether.c Check that rt_mask(rt) is non-NULL before dereferencing it, in the 2004-10-26 03:31:58 +00:00
if_ether.h Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
igmp_var.h Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
igmp.c Lock down parallel router_info list for tracking multicast IGMP 2004-06-11 03:42:37 +00:00
igmp.h White space cleanup for netinet before branch: 2004-08-16 18:32:07 +00:00
in_cksum.c Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
in_gif.c Ensure that dst is bzeroed before calling rtalloc_ign(), to avoid possible 2004-06-18 02:04:07 +00:00
in_gif.h - fix typo in comment. 2003-10-07 17:46:18 +00:00
in_pcb.c Push acquisition of the accept mutex out of sofree() into the caller 2004-10-18 22:19:43 +00:00
in_pcb.h Add a macro for the destruction of INP_INFO_LOCK's used by loadable modules. 2004-10-19 14:34:13 +00:00
in_proto.c Convert IPDIVERT into a loadable module. This makes use of the dynamic loadability 2004-10-19 21:14:57 +00:00
in_rmx.c Introduce tcp_hostcache and remove the tcp specific metrics from 2003-11-20 20:07:39 +00:00
in_systm.h Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
in_var.h Properly declare the "net.inet" sysctl subtree. 2004-10-19 21:06:14 +00:00
in.c White space cleanup for netinet before branch: 2004-08-16 18:32:07 +00:00
in.h Pre-emptively define IPPROTO_SPACER to 32767, the same value as PROTO_SPACER 2004-10-19 20:59:01 +00:00
ip6.h Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
ip_divert.c IPDIVERT is a module now and tell the other parts of the kernel about it. 2004-10-25 20:02:34 +00:00
ip_divert.h Convert IPDIVERT into a loadable module. This makes use of the dynamic loadability 2004-10-19 21:14:57 +00:00
ip_dummynet.c Allocate memory when dumping pipes with M_WAITOK flag. 2004-08-25 09:31:30 +00:00
ip_dummynet.h Convert ipfw to use PFIL_HOOKS. This is change is transparent to userland 2004-08-17 22:05:54 +00:00
ip_ecn.c add ECN support in layer-3. 2003-10-29 15:07:04 +00:00
ip_ecn.h add ECN support in layer-3. 2003-10-29 15:07:04 +00:00
ip_encap.c Lock down IP-layer encapsulation library: 2004-03-10 02:48:50 +00:00
ip_encap.h
ip_fastfwd.c Make comments more clear. Change the order of one if() statement to check the 2004-10-19 14:31:56 +00:00
ip_fw2.c Remove RFC1644 T/TCP support from the TCP side of the network stack. 2004-11-02 22:22:22 +00:00
ip_fw_pfil.c Convert IPDIVERT into a loadable module. This makes use of the dynamic loadability 2004-10-19 21:14:57 +00:00
ip_fw.h Add support to IPFW for matching by TCP data length. 2004-10-03 00:47:15 +00:00
ip_gre.c White space cleanup for netinet before branch: 2004-08-16 18:32:07 +00:00
ip_gre.h de-__P(). 2002-10-16 22:27:27 +00:00
ip_icmp.c Remove the last two global variables that are used to store packet state while 2004-09-15 20:13:26 +00:00
ip_icmp.h Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
ip_id.c White space cleanup for netinet before branch: 2004-08-16 18:32:07 +00:00
ip_input.c Support for dynamically loadable and unloadable IP protocols in the ipmux. 2004-10-19 15:45:57 +00:00
ip_mroute.c When running with debug.mpsafenet=0, initialize IP multicast routing 2004-10-07 14:13:35 +00:00
ip_mroute.h White space cleanup for netinet before branch: 2004-08-16 18:32:07 +00:00
ip_output.c Add an additional struct inpcb * argument to pfil(9) in order to enable 2004-09-29 04:54:33 +00:00
ip_var.h Support for dynamically loadable and unloadable IP protocols in the ipmux. 2004-10-19 15:45:57 +00:00
ip.h Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
ipprotosw.h Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
pim_var.h New PIM header files. 2003-08-07 18:17:43 +00:00
pim.h Include <sys/types.h> for autoconf/automake detection. 2004-03-08 07:45:32 +00:00
raw_ip.c When the access control on creating raw sockets was modified so that 2004-10-12 16:47:25 +00:00
tcp_debug.c Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
tcp_debug.h White space cleanup for netinet before branch: 2004-08-16 18:32:07 +00:00
tcp_fsm.h Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
tcp_hostcache.c Remove RFC1644 T/TCP support from the TCP side of the network stack. 2004-11-02 22:22:22 +00:00
tcp_input.c Remove RFC1644 T/TCP support from the TCP side of the network stack. 2004-11-02 22:22:22 +00:00
tcp_output.c Remove RFC1644 T/TCP support from the TCP side of the network stack. 2004-11-02 22:22:22 +00:00
tcp_reass.c Remove RFC1644 T/TCP support from the TCP side of the network stack. 2004-11-02 22:22:22 +00:00
tcp_sack.c Add a matching tunable for net.inet.tcp.sack.enable sysctl. 2004-10-26 08:59:09 +00:00
tcp_seq.h Remove RFC1644 T/TCP support from the TCP side of the network stack. 2004-11-02 22:22:22 +00:00
tcp_subr.c Remove RFC1644 T/TCP support from the TCP side of the network stack. 2004-11-02 22:22:22 +00:00
tcp_syncache.c Remove RFC1644 T/TCP support from the TCP side of the network stack. 2004-11-02 22:22:22 +00:00
tcp_timer.c Remove RFC1644 T/TCP support from the TCP side of the network stack. 2004-11-02 22:22:22 +00:00
tcp_timer.h White space cleanup for netinet before branch: 2004-08-16 18:32:07 +00:00
tcp_timewait.c Remove RFC1644 T/TCP support from the TCP side of the network stack. 2004-11-02 22:22:22 +00:00
tcp_usrreq.c Remove RFC1644 T/TCP support from the TCP side of the network stack. 2004-11-02 22:22:22 +00:00
tcp_var.h Remove RFC1644 T/TCP support from the TCP side of the network stack. 2004-11-02 22:22:22 +00:00
tcp.h Remove RFC1644 T/TCP support from the TCP side of the network stack. 2004-11-02 22:22:22 +00:00
tcpip.h White space cleanup for netinet before branch: 2004-08-16 18:32:07 +00:00
udp_usrreq.c Until this change, the UDP input code used global variables udp_in, 2004-11-04 01:25:23 +00:00
udp_var.h White space cleanup for netinet before branch: 2004-08-16 18:32:07 +00:00
udp.h Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00