From: Claudio Takahasi Date: Tue, 7 Jan 2014 12:07:47 +0000 (-0300) Subject: Bluetooth: Fix setting Universal/Local bit X-Git-Tag: next-20140108~59^2~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b071a620995def138bf5f5da8440d93bde4171d3;p=karo-tx-linux.git Bluetooth: Fix setting Universal/Local bit This patch fixes the Bluetooth Low Energy Address type checking when setting Universal/Local bit for the 6loWPAN network device or for the peer device connection. ADDR_LE_DEV_PUBLIC or ADDR_LE_DEV_RANDOM are the values allowed for "src_type" and "dst_type" in the hci_conn struct. The Bluetooth link type can be obtainned reading the "type" field in the same struct. Signed-off-by: Claudio Takahasi Signed-off-by: Gustavo Padovan --- diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c index 5f0b11d94d95..ab4e7712457b 100644 --- a/net/bluetooth/6lowpan.c +++ b/net/bluetooth/6lowpan.c @@ -623,7 +623,7 @@ static void set_addr(u8 *eui, u8 *addr, u8 addr_type) eui[0] ^= 2; /* Universal/local bit set, RFC 4291 */ - if (addr_type == BDADDR_LE_PUBLIC) + if (addr_type == ADDR_LE_DEV_PUBLIC) eui[0] |= 1; else eui[0] &= ~1;