[BUG] Bug State Transition From FIN_WAIT_1.

Aperta
#1,303 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
c
Ambito
networking

Direzione di ricerca

Start in FreeRTOS_TCP_State_Handling.c, in prvTCPHandleFin and the eFIN_WAIT_1/eFIN_WAIT_2 branches the issue cites (around lines 231-302). Compare the transitions with RFC793 page 74: a FIN that has been ACKed should go to TIME_WAIT, and an unacknowledged FIN should go to CLOSING, not CLOSE_WAIT or LAST_ACK. Done means simultaneous close follows those transitions, and the change is checked against the TCP state tests in the repository.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Describe the bug
The current implementation of the TCP state machine in FreeRTOS_TCP_State_Handling.c does not fully follow RFC793 behavior for connection termination when handling simultaneous close ( both sides send FIN). The stack transitions to CLOSE_WAIT rather than properly handling the CLOSING/TIME_WAIT states as specified by the RFC793.

Specifically, as specified in RFC793 [Page 74], when the state is in FIN-WAIT-1 STATE, it specifies:

If our FIN has been ACKed (perhaps in this segment), then enter TIME-WAIT, start the time-wait timer, turn off the other timers; otherwise, enter the CLOSING state.

When is FIN-WAIT2

Enter the TIME-WAIT state.  Start the time-wait timer, turn off the other timers.

However, In FreeRTOS_TCP_State_Handling.c, when the state is eFIN_WAIT_1 or eFIN_WAIT_2, it goes into the function prvTCPHandleFin. However, the implementation, when FIN is ACKed, it enters to CLOSE_WAIT (Line 302) instead of TIME_WAIT. When not ACKed, the implementation enters into LAST_ACK (Line 273) instead of CLOSING specified.

https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/22c095e9c3bff7773085dd9b061a0013200eadda/source/FreeRTOS_TCP_State_Handling.c#L231-L302

Lingua principale
C
Stelle
215
Fork
222
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di FreeRTOS/FreeRTOS-Plus-TCP

Tutte le issue di FreeRTOS/FreeRTOS-Plus-TCP

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.