Commit 74318e61 authored by Mariusz Skamra's avatar Mariusz Skamra Committed by Johan Hedberg
Browse files

Bluetooth: Change l2cap accept callback return error



This changes EKEYREJECTED to EPERM due to newlib dependencies
errors.

Signed-off-by: default avatarMariusz Skamra <mariusz.skamra@codecoup.pl>
parent 8d204f85
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -249,7 +249,7 @@ struct bt_l2cap_server {
	 *  Possible return values:
	 *  -ENOMEM if no available space for new channel.
	 *  -EACCES if application did not authorize the connection.
	 *  -EKEYREJECTED if encryption key size is too short.
	 *  -EPERM if encryption key size is too short.
	 */
	int (*accept)(struct bt_conn *conn, struct bt_l2cap_chan **chan);

+1 −1
Original line number Diff line number Diff line
@@ -730,7 +730,7 @@ static u16_t le_err_to_result(int err)
		return BT_L2CAP_LE_ERR_NO_RESOURCES;
	case -EACCES:
		return BT_L2CAP_LE_ERR_AUTHORIZATION;
	case -EKEYREJECTED:
	case -EPERM:
		return BT_L2CAP_LE_ERR_KEY_SIZE;
	default:
		return BT_L2CAP_LE_ERR_UNACCEPT_PARAMS;
+1 −1
Original line number Diff line number Diff line
@@ -175,7 +175,7 @@ static int l2cap_accept_policy(struct bt_conn *conn)
		u8_t enc_key_size = bt_conn_enc_key_size(conn);

		if (enc_key_size && enc_key_size < BT_ENC_KEY_SIZE_MAX) {
			return -EKEYREJECTED;
			return -EPERM;
		}
	} else if (l2cap_policy == L2CAP_POLICY_WHITELIST) {
		for (i = 0; i < ARRAY_SIZE(l2cap_whitelist); i++) {