Re: [PATCH 1/2] Bluetooth: Add SMP support to user_confirm_reply

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

 



Hi Brian,

> >> +	conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK,&cp->bdaddr);
> >> +	if (!conn) {
> >> +		conn = hci_conn_hash_lookup_ba(hdev, LE_LINK,&cp->bdaddr);
> >> +		if (!conn) {
> >> +			err = cmd_status(sk, index, mgmt_op, ENOTCONN);
> >> +			goto done;
> >> +		}
> >> +
> >> +		/* Forward Confirm response to SMP */
> >> +
> >> +		err = cmd_status(sk, index, mgmt_op, 0);
> >> +		goto done;
> >> +
> >>   	}
> >
> > I am a bit lost why we are trying to find an ACL_LINK here first.
> 
> We want to route the confirmation to the Secure Simple Pair HCI command 
> if this is being done on an ACL link, and to the SMP pairing algorythm 
> if it is being done on an LE link.
> 
> While I suppose we could route all non-LE results to the related HCI 
> command, it seemed cleaner to me to reject it with an ENOTCONN, rather 
> than make an invalid HCI call, and depending on the baseband generating 
> the error.

now I am getting it. This is not really obvious when you look at the
code for the first time. Reason is that the ENOTCONN is too nested to be
obvious. Care to add a comment about this so I do not ask dumb question
next time ;)

Regards

Marcel


--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux