Skip to main content
Visitor II
August 17, 2009
Question

uIP Bug Introduced

  • August 17, 2009
  • 1 reply
  • 619 views
Posted on August 17, 2009 at 12:03

uIP Bug Introduced

    This topic has been closed for replies.

    1 reply

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 09:59

    There appears to have been a bug introduced to the uIP main loop in the application note/example um0238 from ST. This bug is not in the original uIP 0.9 source code.

    The problem is the line:

    if (size > 0) uip_len = size;

    This should be:

    uip_len = size;

    Otherwise, if some non-IP and non-ARP packet is recieved (i.e. another type of ethernet data), then uip_len is set greater than zero, but not cleared until an IP or ARP packet is recieved.

    http://en.wikipedia.org/wiki/Ethertype

    An alternative fix would be to have:

    else { uip_len = 0; }

    if both 'if (BUF->type==...' checks fail.