CVSROOT: /cvs
Module name: src
Changes by: [email protected] 2026/04/21 12:36:13
Modified files:
sys/netinet : tcp_input.c
Log message:
A packet with a FIN flag needs to act as a barrier in tcp_flush_queue.
Once a FIN packet is received all following data should simply be
discarded. tcp_input handels this FIN but for that tcp_reass() needs
to properly return TH_FIN when a FIN is processed in tcp_flush_queue.
This reassembly was not quite correct. Unexpected data directly following
the FIN packet was also reassembled and the FIN was actually lost.
The failure to return TH_FIN caused the regression in the previous fix.
tcp_input() passes some FIN packets through reassembly even though they
are in sequence and the queue is empty.
tcp_flush_queue() needs to treat packets with TH_FIN set as a barrier
and stop reassembly after processing this last packet. This ensures that
tcp_reass() returns TH_FIN to tcp_input which then changes the state of
the session. It also ensures that only data up to the FIN packet are
passed to userland.
Reported by Xint Code
OK sashan@