From aad76acb6820173d6e053461cefcef0e21825932 Mon Sep 17 00:00:00 2001 From: sg Date: Wed, 26 Aug 2015 21:20:13 +0200 Subject: [PATCH] IPV6_REASS: fix ip6_reass_remove_oldest_datagram() when the first fragment to enqueue has more pbufs than IP_REASS_MAX_PBUFS --- src/core/ipv6/ip6_frag.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/ipv6/ip6_frag.c b/src/core/ipv6/ip6_frag.c index 1e3ef586..8e0a4295 100644 --- a/src/core/ipv6/ip6_frag.c +++ b/src/core/ipv6/ip6_frag.c @@ -227,6 +227,10 @@ ip6_reass_remove_oldest_datagram(struct ip6_reassdata *ipr, int pbufs_needed) } r = r->next; } + if (oldest == ipr) { + /* nothing to free, ipr is the only element on the list */ + return; + } if (oldest != NULL) { ip6_reass_free_complete_datagram(oldest); }