]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
tcp: fix simultaneous open and refine e80062a2d43
authorGleb Smirnoff <glebius@FreeBSD.org>
Wed, 21 Sep 2022 21:02:49 +0000 (14:02 -0700)
committerGleb Smirnoff <glebius@FreeBSD.org>
Wed, 21 Sep 2022 21:02:49 +0000 (14:02 -0700)
commit493105c2a8f95be99b5299af650fcf8b59b91f55
treea53d50c3f26206e512f412d21b57f42bb1665cc6
parentd819ddba9aa458f6e91df059426d9a2f1ac0b92d
tcp: fix simultaneous open and refine e80062a2d43

- The soisconnected() call on transition from SYN_RCVD to ESTABLISHED
  is also necessary for a half-synchronized connection.  Fix that
  just setting the flag, when we transfer SYN-SENT -> SYN-RECEIVED.
- Provide a comment that explains at what conditions the call to
  soisconnected() is necessary.
- Hence mechanically rename the TF_INCQUEUE flag to TF_SONOTCONN.
- Extend the change to the BBR and RACK stacks.

Note: the interaction between the accept_filter(9) and the socket layer
is not fully consistent, yet.  For most accept filters this call to
soisconnected() will not move the connection from the incomplete queue
to the complete.  The move would happen only when the filter has received
the desired data, and soisconnected() would be called once again from
sorwakeup().  Ideally, we should mark socket as connected only there,
and leave the soisconnected() from SYN_RCVD->ESTABLISHED only for the
simultaneous open case.  However, this doesn't yet work.

Reviewed by: rscheff, tuexen, rrs
Differential revision: https://reviews.freebsd.org/D36641
sys/netinet/tcp_input.c
sys/netinet/tcp_stacks/bbr.c
sys/netinet/tcp_stacks/rack.c
sys/netinet/tcp_syncache.c
sys/netinet/tcp_usrreq.c
sys/netinet/tcp_var.h