Skip to content

Commit 87f5fed

Browse files
LuDudaJohan Hedberg
authored andcommitted
Bluetooth: 6lowpan: Fix handling of uncompressed IPv6 packets
This patch fixes incorrect handling of the 6lowpan packets that contain uncompressed IPv6 header. RFC4944 specifies a special dispatch for 6lowpan to carry uncompressed IPv6 header. This dispatch (1 byte long) has to be removed during reception and skb data pointer has to be moved. To correctly point in the beginning of the IPv6 header the dispatch byte has to be pulled off before packet can be processed by netif_rx_in(). Test scenario: IPv6 packets are not correctly interpreted by the network layer when IPv6 header is not compressed (e.g. ICMPv6 Echo Reply is not propagated correctly to the ICMPv6 layer because the extra byte will make the header look corrupted). Similar approach is done for IEEE 802.15.4. Signed-off-by: Lukasz Duda <lukasz.duda@nordicsemi.no> Signed-off-by: Glenn Ruben Bakke <glenn.ruben.bakke@nordicsemi.no> Acked-by: Jukka Rissanen <jukka.rissanen@linux.intel.com> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Cc: stable@vger.kernel.org # 4.4+
1 parent 4c58f32 commit 87f5fed

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/bluetooth/6lowpan.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,9 @@ static int recv_pkt(struct sk_buff *skb, struct net_device *dev,
307307

308308
/* check that it's our buffer */
309309
if (lowpan_is_ipv6(*skb_network_header(skb))) {
310+
/* Pull off the 1-byte of 6lowpan header. */
311+
skb_pull(skb, 1);
312+
310313
/* Copy the packet so that the IPv6 header is
311314
* properly aligned.
312315
*/

0 commit comments

Comments
 (0)