aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-07-09 12:18:11 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-07-09 12:23:06 -0400
commitc072d546c20390fea0e5332d00fd1b67366ca013 (patch)
tree75a1ac41740b8d151cc18757f2496ada4f0534f4 /net
parente247605a6247aff887d435d2334ffe0e581dae24 (diff)
Bluetooth: Fix incorrect clearing of SMP_FLAG_INITIATOR
When the SMP context is created all flags default to zero. To determine that we are the initiators it's therefore best to simply change the flag value when we know we're sending the first SMP PDU. Clearing the flag when receiving a Pairing Request is not correct since the request may be a response to a previous Security Request from us (for which we would already have correctly set the flag). Same goes for receiving a Security Request which may be coming after us already starting pairing by sending a Pairing Request. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/smp.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index a5e51c686469..627d683203cf 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -735,8 +735,6 @@ static u8 smp_cmd_pairing_req(struct l2cap_conn *conn, struct sk_buff *skb)
735 if (ret) 735 if (ret)
736 return SMP_UNSPECIFIED; 736 return SMP_UNSPECIFIED;
737 737
738 clear_bit(SMP_FLAG_INITIATOR, &smp->flags);
739
740 return 0; 738 return 0;
741} 739}
742 740
@@ -927,8 +925,6 @@ static u8 smp_cmd_security_req(struct l2cap_conn *conn, struct sk_buff *skb)
927 925
928 smp_send_cmd(conn, SMP_CMD_PAIRING_REQ, sizeof(cp), &cp); 926 smp_send_cmd(conn, SMP_CMD_PAIRING_REQ, sizeof(cp), &cp);
929 927
930 clear_bit(SMP_FLAG_INITIATOR, &smp->flags);
931
932 return 0; 928 return 0;
933} 929}
934 930