Quantcast
Channel: Embedded Software (Read Only)
Viewing all articles
Browse latest Browse all 25965

Forum Post: Pointer modification transmitting small chained packets

$
0
0

Hi,

In the Ethernet examples in StarterWare for AM335x there is the following code sequence in the file cpswif.c (Procedure "cpswif_output"):

  /**    * Adjust the packet length if less than minimum required.    */   if(p->tot_len < MIN_PKT_LEN) {     p->tot_len = MIN_PKT_LEN;      while(p->next != NULL) {       p->next->tot_len = p->tot_len - p->len;       p = p->next;     }      /* Adjust the length of the last pbuf. (contents - don't care) */     p->len = p->tot_len;   }

This sequence does modify the pointer "p" in the case of short chained packet needs to be transmitted. My opinion is that this code sequence should not modify the pointer "p" but instead should use a temporary pointer to do this.

Any feedback is appreciated. Thanks.
Patrick


Viewing all articles
Browse latest Browse all 25965

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>