Drop packet if there are not enough free buffers to perform fragmentation
This commit is contained in:
parent
8b72ab49c0
commit
68b9412776
5 changed files with 34 additions and 1 deletions
|
@ -107,5 +107,18 @@ memb_inmemb(struct memb *m, void *ptr)
|
|||
(char *)ptr < (char *)m->mem + (m->num * m->size);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int
|
||||
memb_numfree(struct memb *m)
|
||||
{
|
||||
int i;
|
||||
int num_free = 0;
|
||||
|
||||
for(i = 0; i < m->num; ++i) {
|
||||
if(m->count[i] == 0) {
|
||||
++num_free;
|
||||
}
|
||||
}
|
||||
|
||||
return num_free;
|
||||
}
|
||||
/** @} */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue