Skip to contentSkip to conversation

Bluetooth: Remove redundant check for remote_key_dist

PATCH In review [email protected] 2 participants 4 messages Aug 7, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Bluetooth: Remove redundant check for remote_key_dist

From: Johan Hedberg <[email protected]>

In the smp_cmd_sign_info() function the SMP_DIST_SIGN bit is explicitly cleared early on in the function. This means that there's no need to check for it again before calling smp_distribute_keys().

---
 net/bluetooth/smp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
net/bluetooth/smp.c +1 -2
index fd3294300803..40db728f044b 100644
@@ -1168,8 +1168,7 @@ static int smp_cmd_sign_info(struct l2cap_conn *conn, struct sk_buff *skb)
 		memcpy(csrk->val, rp->csrk, sizeof(csrk->val));
 	}
 	smp->csrk = csrk;
-	if (!(smp->remote_key_dist & SMP_DIST_SIGN))
-		smp_distribute_keys(conn);
+	smp_distribute_keys(conn);
 	hci_dev_unlock(hdev);
 
 	return 0;
Signature · 1 line
1.9.3
#1 lore raw

PATCH 2/2 Bluetooth: Fix confusion between parent and child channel for 6lowpan

From: Johan Hedberg <[email protected]>

The new_connection L2CAP channel callback creates a new channel based on the provided parent channel. The 6lowpan code was confusingly naming the child channel "pchan" and the parent channel "chan". This patch swaps the names.

---
 net/bluetooth/6lowpan.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
net/bluetooth/6lowpan.c +5 -5
index 206b65ccd5b8..35ebe79c87b0 100644
@@ -772,16 +772,16 @@ static inline void chan_ready_cb(struct l2cap_chan *chan)
 	ifup(dev->netdev);
 }
 
-static inline struct l2cap_chan *chan_new_conn_cb(struct l2cap_chan *chan)
+static inline struct l2cap_chan *chan_new_conn_cb(struct l2cap_chan *pchan)
 {
-	struct l2cap_chan *pchan;
+	struct l2cap_chan *chan;
 
-	pchan = chan_open(chan);
-	pchan->ops = chan->ops;
+	chan = chan_open(pchan);
+	chan->ops = pchan->ops;
 
 	BT_DBG("chan %p pchan %p", chan, pchan);
 
-	return pchan;
+	return chan;
 }
 
 static void delete_netdev(struct work_struct *work)
Signature · 1 line
1.9.3
maintainer
#3 lore raw
In reply to [email protected]

Hi Johan,

Quoted 8 lines

In the smp_cmd_sign_info() function the SMP_DIST_SIGN bit is explicitly cleared early on in the function. This means that there's no need to check for it again before calling smp_distribute_keys().

---
net/bluetooth/smp.c | 3 +--

1 file changed, 1 insertion(+), 2 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel

maintainer
#2 lore raw

Re: [PATCH 2/2] Bluetooth: Fix confusion between parent and child channel for 6lowpan

In reply to [email protected]

Hi Johan,

Quoted 9 lines

The new_connection L2CAP channel callback creates a new channel based on the provided parent channel. The 6lowpan code was confusingly naming the child channel "pchan" and the parent channel "chan". This patch swaps the names.

---
net/bluetooth/6lowpan.c | 10 +++++-----

1 file changed, 5 insertions(+), 5 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel