Hi Guys,

I'm trying to port lwIP 1.3.2 to a NXP LPC1768. I'm using CoOS (www.coocox.com) as my rtos. ARP is working fine. If I ping my device I get an ARP respond. But ICMP requests don't get a reply.

I found out that all IP packets getting dropped.

  if ((iphdr_hlen > p->len) || (iphdr_len > p->tot_len)) {
    if (iphdr_hlen > p->len)
LWIP_DEBUGF(IP_DEBUG | 2, ("IP header (len %"U16_F") does not fit in first pbuf (len %"U16_F"), IP packet dropped.\n",
                               iphdr_hlen, p->len));
    if (iphdr_len > p->tot_len)
LWIP_DEBUGF(IP_DEBUG | 2, ("IP (len %"U16_F") is longer than pbuf (len %"U16_F"), "
                               "IP packet dropped.\n",
                               iphdr_len, p->tot_len));
    /* free (drop) packet pbufs */
    pbuf_free(p);
    IP_STATS_INC(ip.lenerr);
    IP_STATS_INC(ip.drop);
    snmp_inc_ipindiscards();
    printf("Buffer Error\n");
    return ERR_OK;
  }

This code snippet is out of ip.c at line 250. The if condition (iphdr_len > p->tot_len) is true and so the packet gets dropped. The IP packet is corect. Checked with Wireshark. The IP-Header length is 20 byte and IP-data is 40 byte (correct for ICMP-Pig Request). But p->tot_len is always 58 or 59 in order to be greater than 60 byte (whole IP packet).

I hope someone could help me.

Thanks in advance!
Best regards from Austria
Robert




_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to