Skip to content

Commit

Permalink
tipc: mark head of reassembly buffer as non-linear
Browse files Browse the repository at this point in the history
The message reassembly function does not update the 'len' and 'data_len'
fields of the head skbuff correctly when fragments are chained to it.
This may sometimes lead to obsure errors, such as fragment reordering
when we receive fragments which are cloned buffers.

This commit fixes this, by ensuring that the two fields are updated
correctly.

Suggested-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Reviewed-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jon Paul Maloy authored and David S. Miller committed May 14, 2014
1 parent ec37dcd commit 5074ab8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/tipc/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -2341,6 +2341,8 @@ int tipc_link_frag_rcv(struct sk_buff **head, struct sk_buff **tail,
(*tail)->next = frag;
*tail = frag;
(*head)->truesize += frag->truesize;
(*head)->data_len += frag->len;
(*head)->len += frag->len;
}
if (fragid == LAST_FRAGMENT) {
*fbuf = *head;
Expand Down

0 comments on commit 5074ab8

Please sign in to comment.