aboutsummaryrefslogtreecommitdiff
path: root/net/net.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/net.c')
-rw-r--r--net/net.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/net/net.c b/net/net.c
index 073fb68..6f0a483 100644
--- a/net/net.c
+++ b/net/net.c
@@ -985,10 +985,14 @@ static struct ip_udp_hdr *__net_defragment(struct ip_udp_hdr *ip, int *lenp)
}
/*
- * There is some overlap: fix the hole list. This code doesn't
- * deal with a fragment that overlaps with two different holes
- * (thus being a superset of a previously-received fragment).
+ * There is some overlap: fix the hole list. This code deals
+ * with a fragment that overlaps with two different holes
+ * (thus being a superset of a previously-received fragment)
+ * by only using the part of the fragment that fits in the
+ * first hole.
*/
+ if (h->last_byte < start + len)
+ len = h->last_byte - start;
if ((h >= thisfrag) && (h->last_byte <= start + len)) {
/* complete overlap with hole: remove hole */