Interniche Stack -- tcp_send documentation error

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Interniche Stack -- tcp_send documentation error

1,636件の閲覧回数
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
ラベル(1)
0 件の賞賛
返信
1 返信

732件の閲覧回数
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 件の賞賛
返信