lwIP - A Lightweight TCP/IP stack - Bugs: bug #46594, Useless condition judegement
You are not allowed to post comments on this tracker with your current authentication level.
bug #46594: Useless condition judegement
Submitter: | April M <april_m> | ||
Submitted: | Thu 03 Dec 2015 05:24:37 AM UTC | ||
Category: | Network drivers | Severity: | 3 - Normal |
Item Group: | Change Request | Status: | Invalid |
Privacy: | Public | Assigned to: | None |
Open/Closed: | Closed | Planned Release: | None |
lwIP version: | git head |
Thu 03 Dec 2015 04:21:05 PM UTC, comment #2: |
Joel Cunningham <jcunningham> |
Thu 03 Dec 2015 03:11:19 PM UTC, comment #1: Without looking at the context of this code, it's seems probable that the code was checking if the loop_cnt_current would wrap the 16 bit value? |
Patrick Klos <pklos> |
Thu 03 Dec 2015 05:24:37 AM UTC, original submission:
In netif.c netif_loop_outpu() Line 725
|
April M <april_m> |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 2 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2015-12-05 | dziegel | Status | None | Invalid | |
Open/Closed | Open | Closed |
Powered by Savane 3.13-caa5.
Corresponding source code
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