ChrisChelmecki wrote:
Based on examination of the stacks lower levels and the m_send function, it looks like the application should only free the packet if the error is EWOULDBLOCK or ENOTCONN.
I agree. If tcp_send() returns an error, the app must check the error code before freeing the packet.
m_send() does this correctly only for EWOULDBLOCK.
I added the following to m_send() just before the last "so->error = err;"
if (err == ENOTCONN)
tcp_pktfree( pkt );