lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #46594] Useless condition judegement


From: Joel Cunningham
Subject: [lwip-devel] [bug #46594] Useless condition judegement
Date: Thu, 03 Dec 2015 16:21:05 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0

Follow-up Comment #2, bug #46594 (project lwip):

Here's the entire block of code.  Comment above indicates it's checking for
loop_cnt_current overflowing and wrapping (which would be a smaller value)

#if LWIP_LOOPBACK_MAX_PBUFS
  clen = pbuf_clen(r);
  /* check for overflow or too many pbuf on queue */
  if(((netif->loop_cnt_current + clen) < netif->loop_cnt_current) ||
     ((netif->loop_cnt_current + clen) > LWIP_LOOPBACK_MAX_PBUFS)) {
    pbuf_free(r);
    LINK_STATS_INC(link.memerr);
    LINK_STATS_INC(link.drop);
    MIB2_STATS_NETIF_INC(stats_if, ifoutdiscards);
    return ERR_MEM;
  }

This seems like a valid check to me

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?46594>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]