mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-01 04:12:07 +00:00
fixed bug #38210 (ip reassembly while remove oldest datagram)
This commit is contained in:
parent
83740d81f2
commit
4eb9efdd33
@ -202,6 +202,9 @@ HISTORY
|
|||||||
|
|
||||||
++ Bugfixes:
|
++ Bugfixes:
|
||||||
|
|
||||||
|
2015-02-25: patch by Greg Renda
|
||||||
|
* ip4_frag.c: fixed bug #38210 (ip reassembly while remove oldest datagram)
|
||||||
|
|
||||||
2015-02-25: Simon Goldschmidt
|
2015-02-25: Simon Goldschmidt
|
||||||
* sockets.c: fixed bug #38165 (socket with mulicast): ensure igmp membership
|
* sockets.c: fixed bug #38165 (socket with mulicast): ensure igmp membership
|
||||||
are dropped when socket (not netconn!) is closed.
|
are dropped when socket (not netconn!) is closed.
|
||||||
|
@ -223,7 +223,7 @@ ip_reass_remove_oldest_datagram(struct ip_hdr *fraghdr, int pbufs_needed)
|
|||||||
/* @todo Can't we simply remove the last datagram in the
|
/* @todo Can't we simply remove the last datagram in the
|
||||||
* linked list behind reassdatagrams?
|
* linked list behind reassdatagrams?
|
||||||
*/
|
*/
|
||||||
struct ip_reassdata *r, *oldest, *prev;
|
struct ip_reassdata *r, *oldest, *prev, *oldest_prev;
|
||||||
int pbufs_freed = 0, pbufs_freed_current;
|
int pbufs_freed = 0, pbufs_freed_current;
|
||||||
int other_datagrams;
|
int other_datagrams;
|
||||||
|
|
||||||
@ -232,6 +232,7 @@ ip_reass_remove_oldest_datagram(struct ip_hdr *fraghdr, int pbufs_needed)
|
|||||||
do {
|
do {
|
||||||
oldest = NULL;
|
oldest = NULL;
|
||||||
prev = NULL;
|
prev = NULL;
|
||||||
|
oldest_prev = NULL;
|
||||||
other_datagrams = 0;
|
other_datagrams = 0;
|
||||||
r = reassdatagrams;
|
r = reassdatagrams;
|
||||||
while (r != NULL) {
|
while (r != NULL) {
|
||||||
@ -240,9 +241,11 @@ ip_reass_remove_oldest_datagram(struct ip_hdr *fraghdr, int pbufs_needed)
|
|||||||
other_datagrams++;
|
other_datagrams++;
|
||||||
if (oldest == NULL) {
|
if (oldest == NULL) {
|
||||||
oldest = r;
|
oldest = r;
|
||||||
|
oldest_prev = prev;
|
||||||
} else if (r->timer <= oldest->timer) {
|
} else if (r->timer <= oldest->timer) {
|
||||||
/* older than the previous oldest */
|
/* older than the previous oldest */
|
||||||
oldest = r;
|
oldest = r;
|
||||||
|
oldest_prev = prev;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (r->next != NULL) {
|
if (r->next != NULL) {
|
||||||
@ -251,7 +254,7 @@ ip_reass_remove_oldest_datagram(struct ip_hdr *fraghdr, int pbufs_needed)
|
|||||||
r = r->next;
|
r = r->next;
|
||||||
}
|
}
|
||||||
if (oldest != NULL) {
|
if (oldest != NULL) {
|
||||||
pbufs_freed_current = ip_reass_free_complete_datagram(oldest, prev);
|
pbufs_freed_current = ip_reass_free_complete_datagram(oldest, oldest_prev);
|
||||||
pbufs_freed += pbufs_freed_current;
|
pbufs_freed += pbufs_freed_current;
|
||||||
}
|
}
|
||||||
} while ((pbufs_freed < pbufs_needed) && (other_datagrams > 1));
|
} while ((pbufs_freed < pbufs_needed) && (other_datagrams > 1));
|
||||||
|
Loading…
Reference in New Issue
Block a user