freebsd-skq/sys/netinet
tuexen 9794079730 Fix a bug where messages would not be sent in SHUTDOWN_RECEIVED state.
This problem was reported by Mark Bonnekessel and Markus Boese.
Thanks to Irene Ruengeler for helping me to fix the cause of
the problem. It can be tested with the following packetdrill script:

+0.0 socket(..., SOCK_STREAM, IPPROTO_SCTP) = 3
+0.0 fcntl(3, F_GETFL) = 0x2 (flags O_RDWR)
+0.0 fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
// Check the handshake with an empty(!) cookie
+0.1 connect(3, ..., ...) = -1 EINPROGRESS (Operation now in progress)
+0.0 > sctp: INIT[flgs=0, tag=1, a_rwnd=..., os=..., is=..., tsn=0, ...]
+0.1 < sctp: INIT_ACK[flgs=0, tag=2, a_rwnd=10000, os=1, is=1, tsn=0, STATE_COOKIE[len=4, val=...]]
+0.0 > sctp: COOKIE_ECHO[flgs=0, len=4, val=...]
+0.1 < sctp: COOKIE_ACK[flgs=0]
+0.0 getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
+0.0 write(3, ..., 1024) = 1024
+0.0 > sctp: DATA[flgs=BE, len=1040, tsn=0, sid=0, ssn=0, ppid=0]
+0.0 write(3, ..., 1024) = 1024 // Pending due to Nagle
+0.0 < sctp: SHUTDOWN[flgs=0, cum_tsn=0]
+0.0 > sctp: DATA[flgs=BE, len=1040, tsn=1, sid=0, ssn=1, ppid=0]
+0.0 < sctp: SACK[flgs=0, cum_tsn=1, a_rwnd=10000, gaps=[], dups=[]] // Do we need another SHUTDOWN here?
+0.0 > sctp: SHUTDOWN_ACK[flgs=0]
+0.0 < sctp: SHUTDOWN_COMPLETE[flgs=0]
+0.0 close(3) = 0

MFC after: 3 days
2015-05-28 18:34:02 +00:00
..
cc DCTCP (Data Center TCP) implementation. 2015-01-12 08:33:04 +00:00
khelp
libalias mdoc: fix rendering issues 2015-04-26 11:39:25 +00:00
accf_data.c
accf_dns.c In preparation of merging projects/sendfile, transform bare access to 2014-11-12 09:57:15 +00:00
accf_http.c In preparation of merging projects/sendfile, transform bare access to 2014-11-12 09:57:15 +00:00
cc.h DCTCP (Data Center TCP) implementation. 2015-01-12 08:33:04 +00:00
icmp6.h Implement Enhanced DAD algorithm for IPv6 described in 2015-03-02 17:30:26 +00:00
icmp_var.h
if_atm.c
if_atm.h
if_ether.c lla_lookup() can directly call llentry_free() for static entries 2015-03-07 18:33:08 +00:00
if_ether.h Do not return unlocked/unreferenced lle in arpresolve/nd6_storelladdr - 2014-11-27 23:06:25 +00:00
igmp_var.h - Rename 'struct igmp_ifinfo' into 'struct igmp_ifsoftc', since it really 2015-02-19 22:35:23 +00:00
igmp.c Improve patch for SA-15:04.igmp to solve a potential buffer overflow. 2015-04-07 20:20:03 +00:00
igmp.h
in_cksum.c
in_debug.c
in_gif.c Add an ability accept encapsulated packets from different sources by one 2015-05-15 12:19:45 +00:00
in_kdtrace.c Brief demo script showing the various values that can be read via 2015-04-29 17:19:55 +00:00
in_kdtrace.h Brief demo script showing the various values that can be read via 2015-04-29 17:19:55 +00:00
in_mcast.c Fix build with KTR after r278978. 2015-02-19 15:41:23 +00:00
in_pcb.c CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than ten 2015-05-22 17:05:21 +00:00
in_pcb.h Start process of removing the use of the deprecated "M_FLOWID" flag 2014-12-01 11:45:24 +00:00
in_pcbgroup.c Refactor / restructure the RSS code into generic, IPv4 and IPv6 specific 2015-01-18 18:06:40 +00:00
in_proto.c Finish r274118: remove useless fields from struct domain. 2014-11-06 14:39:04 +00:00
in_rmx.c Kill custom in_matroute() radix mathing function removing one rte mutex lock. 2014-11-11 02:52:40 +00:00
in_rss.c Correctly const-ify things. 2015-03-18 04:40:36 +00:00
in_rss.h Refactor / restructure the RSS code into generic, IPv4 and IPv6 specific 2015-01-18 18:06:40 +00:00
in_systm.h Where appropriate, use the modern terms for the one true time base 2014-12-21 05:07:11 +00:00
in_var.h Move all code related to IP fragment reassembly to ip_reass.c. Some 2015-04-10 06:02:37 +00:00
in.c Provide functions to determine presence of a given address 2015-04-17 11:57:06 +00:00
in.h Provide functions to determine presence of a given address 2015-04-17 11:57:06 +00:00
ip6.h Eliminate use of M_EXT in IP6_EXTHDR_CHECK() by trimming a redundant 2014-10-05 06:28:53 +00:00
ip_carp.c Improve carp(4) locking: 2015-04-21 20:25:12 +00:00
ip_carp.h
ip_divert.c Update ip_divert.ko to depend on version 3 of ipfw. 2014-10-11 16:08:54 +00:00
ip_divert.h
ip_dummynet.h
ip_ecn.c
ip_ecn.h
ip_encap.c
ip_encap.h
ip_fastfwd.c Remove incorrect layering violating code that: 2015-01-12 09:41:12 +00:00
ip_fw.h Make rule table kernel-index rewriting support any kind of objects. 2015-04-27 08:29:39 +00:00
ip_gre.c o Use new function ip_fillid() in all places throughout the kernel, 2015-04-01 22:26:39 +00:00
ip_icmp.c Where appropriate, use the modern terms for the one true time base 2014-12-21 05:07:11 +00:00
ip_icmp.h Where appropriate, use the modern terms for the one true time base 2014-12-21 05:07:11 +00:00
ip_id.c Provide a comment explaining issues with the counter(9) trick, so that 2015-04-02 14:22:59 +00:00
ip_input.c Attempt to fix build after 281351 by defining full prototype for the 2015-04-11 01:06:59 +00:00
ip_ipsec.c Remove now unneded KEY_FREESP() for case when ipsec[46]_process_packet() 2015-04-27 01:11:09 +00:00
ip_ipsec.h Remove flag/flags argument from the following functions: 2014-12-11 18:35:34 +00:00
ip_mroute.c CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than ten 2015-05-22 17:05:21 +00:00
ip_mroute.h
ip_options.c Use M_WRITABLE() and M_LEADINGSPACE() rather than checking M_EXT and 2015-01-06 14:32:28 +00:00
ip_options.h Make net.inet.ip.sourceroute, net.inet.ip.accept_sourceroute, and 2014-09-15 07:20:40 +00:00
ip_output.c Extend fixes made in r278103 and r38754 by copying the complete packet 2015-04-02 15:47:37 +00:00
ip_reass.c Fix RSS build - netisr input / NETISR_IP_DIRECT is used here. 2015-04-15 00:57:21 +00:00
ip_var.h o Use new function ip_fillid() in all places throughout the kernel, 2015-04-01 22:26:39 +00:00
ip.h Change struct attribute to avoid aligned operations mismatch 2015-02-24 12:57:03 +00:00
pim_var.h
pim.h
raw_ip.c o Use new function ip_fillid() in all places throughout the kernel, 2015-04-01 22:26:39 +00:00
sctp_asconf.c Fix a bug where messages would not be sent in SHUTDOWN_RECEIVED state. 2015-05-28 18:34:02 +00:00
sctp_asconf.h
sctp_auth.c Make sure that we don't free an SCTP shared key too early. 2015-03-25 22:45:54 +00:00
sctp_auth.h Use a consistent type for the number of HMAC algorithms. 2014-09-16 14:20:33 +00:00
sctp_bsd_addr.c Minimize the usage of SCTP_BUF_IS_EXTENDED. 2015-01-10 20:49:57 +00:00
sctp_bsd_addr.h
sctp_cc_functions.c Fix and cleanup the debug information. This has no user-visible changes. 2015-05-28 16:00:23 +00:00
sctp_constants.h Fix and cleanup the debug information. This has no user-visible changes. 2015-05-28 16:00:23 +00:00
sctp_crc32.c
sctp_crc32.h
sctp_dtrace_declare.h
sctp_dtrace_define.h
sctp_header.h Fix the reported streams in a SCTP_STREAM_RESET_EVENT, if a 2014-10-16 15:36:04 +00:00
sctp_indata.c Fix and cleanup the debug information. This has no user-visible changes. 2015-05-28 16:00:23 +00:00
sctp_indata.h
sctp_input.c Fix and cleanup the debug information. This has no user-visible changes. 2015-05-28 16:00:23 +00:00
sctp_input.h Fix the reported streams in a SCTP_STREAM_RESET_EVENT, if a 2014-10-16 15:36:04 +00:00
sctp_lock_bsd.h
sctp_os_bsd.h Update a comment to get it aligned with the code change. 2015-03-11 15:40:29 +00:00
sctp_os.h
sctp_output.c Fix a bug where messages would not be sent in SHUTDOWN_RECEIVED state. 2015-05-28 18:34:02 +00:00
sctp_output.h Ensure that the list of streams sent in a stream reset parameter fits 2014-10-08 15:30:59 +00:00
sctp_pcb.c Fix and cleanup the debug information. This has no user-visible changes. 2015-05-28 16:00:23 +00:00
sctp_pcb.h Add a SCTP socket option to limit the cwnd for each path. 2015-03-10 19:49:25 +00:00
sctp_peeloff.c Add a SCTP socket option to limit the cwnd for each path. 2015-03-10 19:49:25 +00:00
sctp_peeloff.h
sctp_ss_functions.c
sctp_structs.h Improve the selection of the destination address of SACK chunks. 2015-03-26 22:05:31 +00:00
sctp_syscalls.c Replace struct filedesc argument in getsock_cap with struct thread 2015-04-11 16:00:33 +00:00
sctp_sysctl.c Remove comparisons which are not necessary. 2015-01-20 19:08:55 +00:00
sctp_sysctl.h Fix the handling of sysctl variables when used with VIMAGE. 2014-09-06 19:12:14 +00:00
sctp_timer.c Fix and cleanup the debug information. This has no user-visible changes. 2015-05-28 16:00:23 +00:00
sctp_timer.h
sctp_uio.h
sctp_usrreq.c Fix and cleanup the debug information. This has no user-visible changes. 2015-05-28 16:00:23 +00:00
sctp_var.h Do the renaming of sb_cc to sb_ccc in a way with less code changes by 2014-12-02 20:29:29 +00:00
sctp.h Add a SCTP socket option to limit the cwnd for each path. 2015-03-10 19:49:25 +00:00
sctputil.c Some more debug info cleanup. 2015-05-28 16:39:22 +00:00
sctputil.h Minimize the usage of SCTP_BUF_IS_EXTENDED. 2015-01-10 20:49:57 +00:00
siftr.c Move the SIFTR DTrace probe out of the writing thread context 2015-04-30 17:43:40 +00:00
tcp_debug.c
tcp_debug.h
tcp_fsm.h
tcp_hostcache.c CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than ten 2015-05-22 17:05:21 +00:00
tcp_hostcache.h Add scope zone id to the in_endpoints and hc_metrics structures. 2014-09-10 16:26:18 +00:00
tcp_input.c Correct the wording as we are increasing the window size. 2015-05-19 19:17:20 +00:00
tcp_lro.c
tcp_lro.h
tcp_offload.c
tcp_offload.h
tcp_output.c To ease changes to underlying mbuf structure and the mbuf allocator, reduce 2015-01-05 09:58:32 +00:00
tcp_reass.c Merge from projects/sendfile: extend protocols API to support 2014-11-30 13:24:21 +00:00
tcp_sack.c Remove SYSCTL_VNET_* macros, and simply put CTLFLAG_VNET where needed. 2014-11-07 09:39:05 +00:00
tcp_seq.h
tcp_subr.c CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than ten 2015-05-22 17:05:21 +00:00
tcp_syncache.c Make syncookie_mac() use 'tcp_seq irs' in computing hash. 2015-01-30 17:29:07 +00:00
tcp_syncache.h
tcp_timer.c Fix an old and well-documented use-after-free race condition in 2015-04-16 10:00:06 +00:00
tcp_timer.h Fix an old and well-documented use-after-free race condition in 2015-04-16 10:00:06 +00:00
tcp_timewait.c Add a state transition call to show that we have entered TIME_WAIT. 2015-05-01 12:49:03 +00:00
tcp_usrreq.c In TCP, connect() can return incorrect error code EINVAL 2015-03-09 20:29:16 +00:00
tcp_var.h Fix an old and well-documented use-after-free race condition in 2015-04-16 10:00:06 +00:00
tcp.h
tcpip.h
toecore.c Do not return unlocked/unreferenced lle in arpresolve/nd6_storelladdr - 2014-11-27 23:06:25 +00:00
toecore.h
udp_usrreq.c Refactor / restructure the RSS code into generic, IPv4 and IPv6 specific 2015-01-18 18:06:40 +00:00
udp_var.h Add context pointer and source address to the UDP tunnel callback 2014-10-10 06:08:59 +00:00
udp.h
udplite.h