inetstack
inetstack copied to clipboard
[tcp] Implement FIN Retransmission
Current code handles initial transmission of FIN by representing FIN as a zero-length buffer on the unsent queue and having the send code (both immediate and background) know to set the FIN bit on the segment when sending this buffer. The zero-length buffer is then placed on the unacknowledged (a.k.a. retransmission) queue.
The retransmission code needs to recognize the FIN marker on the unacknowledged queue and retransmit it. Both the retransmission code and the regular send code should also be able to coalesce the FIN bit onto the last data packet.