|
@@ -161,6 +161,7 @@ static bool batadv_frag_insert_packet(struct batadv_orig_node *orig_node,
|
|
|
hlist_add_head(&frag_entry_new->list, &chain->head);
|
|
|
chain->size = skb->len - hdr_size;
|
|
|
chain->timestamp = jiffies;
|
|
|
+ chain->total_size = ntohs(frag_packet->total_size);
|
|
|
ret = true;
|
|
|
goto out;
|
|
|
}
|
|
@@ -195,9 +196,11 @@ static bool batadv_frag_insert_packet(struct batadv_orig_node *orig_node,
|
|
|
|
|
|
out:
|
|
|
if (chain->size > batadv_frag_size_limit() ||
|
|
|
- ntohs(frag_packet->total_size) > batadv_frag_size_limit()) {
|
|
|
+ chain->total_size != ntohs(frag_packet->total_size) ||
|
|
|
+ chain->total_size > batadv_frag_size_limit()) {
|
|
|
/* Clear chain if total size of either the list or the packet
|
|
|
- * exceeds the maximum size of one merged packet.
|
|
|
+ * exceeds the maximum size of one merged packet. Don't allow
|
|
|
+ * packets to have different total_size.
|
|
|
*/
|
|
|
batadv_frag_clear_chain(&chain->head);
|
|
|
chain->size = 0;
|