Browse Source

Bluetooth: Fix skb length calculation

When we add a fragment to a skb, len and data_len fields need to be
updated.

Signed-off-by: Gustavo Padovan <gustavo@padovan.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Gustavo Padovan 13 years ago
parent
commit
2d0ed3d587
1 changed files with 3 additions and 0 deletions
  1. 3 0
      net/bluetooth/l2cap_core.c

+ 3 - 0
net/bluetooth/l2cap_core.c

@@ -1855,6 +1855,9 @@ static inline int l2cap_skbuff_fromiovec(struct l2cap_chan *chan,
 		sent += count;
 		sent += count;
 		len  -= count;
 		len  -= count;
 
 
+		skb->len += (*frag)->len;
+		skb->data_len += (*frag)->len;
+
 		frag = &(*frag)->next;
 		frag = &(*frag)->next;
 	}
 	}