Hi,
I'm develping an application using the StarterWare with LwIP running in a Beaglebone Black. I found that some small (UDP) packets are lost when the packet lenght is adjusted (less than mininum required) by the function "cpswif_output(struct netif *netif, struct pbuf *p)".
I think the problem could be here:
/**
* 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;
}
After adjusting, the head of the pbuf linkedlist is lost. I fixed the issue by iterating the list with a new pointer variable:
for(q = p; q->next != NULL; q = q->next) {
q->next->tot_len = q->tot_len - q->len;
}
Is this fix ok for you? or Do you think I'm missing something?
Thanks in advance,
Eduardo.-