Patch "Bluetooth: 6lowpan: Set the peer IPv6 address correctly" has been added to the 3.17-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    Bluetooth: 6lowpan: Set the peer IPv6 address correctly

to the 3.17-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     bluetooth-6lowpan-set-the-peer-ipv6-address-correctly.patch
and it can be found in the queue-3.17 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From b2799cec22812f5f1aaaa57133df51876f685d84 Mon Sep 17 00:00:00 2001
From: Jukka Rissanen <jukka.rissanen@xxxxxxxxxxxxxxx>
Date: Mon, 8 Sep 2014 12:11:44 +0300
Subject: Bluetooth: 6lowpan: Set the peer IPv6 address correctly

From: Jukka Rissanen <jukka.rissanen@xxxxxxxxxxxxxxx>

commit b2799cec22812f5f1aaaa57133df51876f685d84 upstream.

The peer IPv6 address contained wrong U/L bit in the EUI-64 part.

Signed-off-by: Jukka Rissanen <jukka.rissanen@xxxxxxxxxxxxxxx>
Signed-off-by: Marcel Holtmann <marcel@xxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
 net/bluetooth/6lowpan.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -671,6 +671,14 @@ static struct l2cap_chan *chan_open(stru
 	return chan;
 }
 
+static void set_ip_addr_bits(u8 addr_type, u8 *addr)
+{
+	if (addr_type == BDADDR_LE_PUBLIC)
+		*addr |= 0x02;
+	else
+		*addr &= ~0x02;
+}
+
 static struct l2cap_chan *add_peer_chan(struct l2cap_chan *chan,
 					struct lowpan_dev *dev)
 {
@@ -693,6 +701,11 @@ static struct l2cap_chan *add_peer_chan(
 	memcpy(&peer->eui64_addr, (u8 *)&peer->peer_addr.s6_addr + 8,
 	       EUI64_ADDR_LEN);
 
+	/* IPv6 address needs to have the U/L bit set properly so toggle
+	 * it back here.
+	 */
+	set_ip_addr_bits(chan->dst_type, (u8 *)&peer->peer_addr.s6_addr + 8);
+
 	write_lock_irqsave(&devices_lock, flags);
 	INIT_LIST_HEAD(&peer->list);
 	peer_add(dev, peer);


Patches currently in stable-queue which might be from jukka.rissanen@xxxxxxxxxxxxxxx are

queue-3.17/bluetooth-6lowpan-set-the-peer-ipv6-address-correctly.patch
queue-3.17/bluetooth-6lowpan-increase-the-connection-timeout-value.patch
queue-3.17/bluetooth-6lowpan-route-packets-that-are-not-meant-to-peer-via-correct-device.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]