add break condition into a possible endless loop

This commit is contained in:
Stefan Lankes 2011-10-13 15:25:10 -07:00
parent 440b87f92e
commit 5bb9e2f066

View file

@ -232,6 +232,7 @@ static err_t rckemacif_output(struct netif* netif, struct pbuf* p)
int rest;
int packets;
int sum = 0;
int chance = 20;
/* check for over/underflow */
if (BUILTIN_EXPECT((p->tot_len < 20 /* IP header size */) || (p->tot_len > 1536), 0)) {
@ -257,6 +258,9 @@ again:
if (sum < packets) {
LWIP_DEBUGF(NETIF_DEBUG, ("Warning: not enough space available, retrying...\n"));
chance--;
if (chance < 0)
return ERR_MEM;
goto again;
}
#endif