Here is some details on half of our solution to window size equal to zero, and more related questions:
Closed sockects seems to not always clean up buffers. This seems to appear only when Interniche units are talking to each other (not when a PC is talking to a Interniche unit).
Observation:
- tcpcb->t_state TCPS_FIN_WAIT_2
- PACKET->inuse true
- Data in PACKET: received from other end
- M_SOCK->state bit SS_NOFDREF set
In the above condition, buffers may be not released properly. Buffers can be locking up the system like this, and after a while the unit can become uncapable of replying even ARP requests.
Could this be "fixed" by setting SS_CANTRCVMORE somewhere? Our (temporary?) fix for this problem is to set M_SOCK->linger equal to zero (by calling the m_ioctl() function).
I'm asking because debugging the function tcp_rcv() seems a bit complex. More specifically, I'm wandering if something can be improved. Possibly close to these lines:
Code:
/* * If the state is CLOSED (i.e., TCB does not exist) then * all data in the incoming segment is discarded. * If the TCB exists but is in CLOSED state, it is embryonic, * but should either do a listen or a connect soon. */ tp = so->tp; if (tp == NULL) GOTO_DROPWITHRESET; if (tp->t_state == TCPS_CLOSED) GOTO_DROP;
Any help, feedback or point-of-views would be appreciated.
Cheers,
Petter