Interniche Stack -- tcp_send documentation error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Interniche Stack -- tcp_send documentation error

1,148 Views
ChrisChelmecki
Contributor I
I think I have run into an inconsistency in the documentation.  It is noted that when using the tcp_send function, if an error is returned, the stack will not free the pkt and the application should do so.  However, it seems that the stack will free packets when an error is returned.  When a pkt is freed the second time, the cpu will spin in a infinite loop in QUEUE_CHECK.

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.

Has anyone else run into this issue?  Does my solution seem reasonable, or is there an ever nastier underlying bug?

Thanks,
Chris Chelmecki
Labels (1)
0 Kudos
1 Reply

244 Views
bkatt
Contributor IV


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 );

0 Kudos