- /* Stop all timers, 2MSL will be set lower */
- tcp_connection_timers_reset (tc0);
+ if (tcp_fin (tcp0))
+ {
+ /* Stop all timers, 2MSL will be set lower */
+ tcp_connection_timers_reset (tc0);
+ }
+ else
+ {
+ /* Wait for peer to finish sending its data */
+ tcp_timer_update (tc0, TCP_TIMER_WAITCLOSE,
+ TCP_2MSL_TIME);
+ }