Re: [bluetooth-next v2 10/16] Bluetooth: Add support for resuming socket when SMP is finished

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

 



Hi Vinicius,

On Thu, Jun 02, 2011, Vinicius Costa Gomes wrote:
> @@ -357,21 +375,16 @@ int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level)
>  	if (IS_ERR(hcon->hdev->tfm))
>  		return 1;
>  
> -	switch (sec_level) {
> -	case BT_SECURITY_MEDIUM:
> -		/* Encrypted, no MITM protection */
> -		authreq = HCI_AT_NO_BONDING_MITM;
> -		break;
> +	if (test_bit(HCI_CONN_ENCRYPT_PEND, &hcon->pend))
> +		return -EINPROGRESS;

This doesn't look right to me. Like hci_conn_security, smp_conn_security
is supposed to be a boolean function by only returning 0 or 1. That's
also how all places use it: "if (smp_conn_security(...))". So returning
a negative error like this looks wrong.

Johan
--
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