This is an implementation of server-side support for TCP Fast Open.
It supports multiple concurrently valid keys for TFO cookie
generation, and those keys can be generated automatically or manually
installed. The TFO SYN|ACK is sent using the delayed ACK timer in
order give the application time to include response data with the
SYN|ACK. See the top comment in tcp_fastopen.h for other
implementation particulars.
Design diagrams/details are available at https://people.freebsd.org/~pkelsey/TFO_Design_Details.pdf
With a few exceptions, all of the code is enabled/disabled by the
kernel config option TCP_RFC7413, so effectively all of the danger is
voluntary. The exceptions to this are:
- a few bits of code that are clearly dependent upon TF_FASTOPEN in tp->t_flags being set and that to #ifdef would have made more spaghetti than I'd like.
- a few changes that I think are proper outside of the TFO context.
Once this passes review, I intend to MFC it to 10-STABLE shortly
thereafter as it is compiled-out by default.