<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>ColdFire/68K Microcontrollers and ProcessorsのトピックRe: Interniche Stack -- tcp_send documentation error</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Interniche-Stack-tcp-send-documentation-error/m-p/131041#M848</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;ChrisChelmecki wrote:&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;I agree. If tcp_send() returns an error, the app must check the error code before freeing the packet.&lt;BR /&gt;&lt;BR /&gt;m_send() does this correctly only for EWOULDBLOCK.&lt;BR /&gt;I added the following to m_send() just before the last "so-&amp;gt;error = err;"&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (err == ENOTCONN)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tcp_pktfree( pkt );&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 May 2007 23:22:41 GMT</pubDate>
    <dc:creator>bkatt</dc:creator>
    <dc:date>2007-05-08T23:22:41Z</dc:date>
    <item>
      <title>Interniche Stack -- tcp_send documentation error</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Interniche-Stack-tcp-send-documentation-error/m-p/131040#M847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think I have run into an inconsistency in the documentation.&amp;nbsp; 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.&amp;nbsp; However, it seems that the stack will free packets when an error is returned.&amp;nbsp; When a pkt is freed the second time, the cpu will spin in a infinite loop in QUEUE_CHECK.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Has anyone else run into this issue?&amp;nbsp; Does my solution seem reasonable, or is there an ever nastier underlying bug?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Chris Chelmecki&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2007 01:55:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Interniche-Stack-tcp-send-documentation-error/m-p/131040#M847</guid>
      <dc:creator>ChrisChelmecki</dc:creator>
      <dc:date>2007-04-19T01:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Interniche Stack -- tcp_send documentation error</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Interniche-Stack-tcp-send-documentation-error/m-p/131041#M848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;ChrisChelmecki wrote:&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;I agree. If tcp_send() returns an error, the app must check the error code before freeing the packet.&lt;BR /&gt;&lt;BR /&gt;m_send() does this correctly only for EWOULDBLOCK.&lt;BR /&gt;I added the following to m_send() just before the last "so-&amp;gt;error = err;"&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (err == ENOTCONN)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tcp_pktfree( pkt );&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2007 23:22:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Interniche-Stack-tcp-send-documentation-error/m-p/131041#M848</guid>
      <dc:creator>bkatt</dc:creator>
      <dc:date>2007-05-08T23:22:41Z</dc:date>
    </item>
  </channel>
</rss>

