From patchwork Sun Aug 6 08:01:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Mikuda X-Patchwork-Id: 710992 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF01EC0015E for ; Sun, 6 Aug 2023 08:01:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229559AbjHFIBn (ORCPT ); Sun, 6 Aug 2023 04:01:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229503AbjHFIBj (ORCPT ); Sun, 6 Aug 2023 04:01:39 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73F481FC1 for ; Sun, 6 Aug 2023 01:01:37 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3174aac120aso2765556f8f.2 for ; Sun, 06 Aug 2023 01:01:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=streamunlimited.com; s=google; t=1691308895; x=1691913695; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ljClwd6RT0VtKU2pAa16ata/SJq7/BZombob/nsC6kk=; b=qBGp1CYx6+w0ISmxvCdGsWG/tULq9H8y3bsdPedVf7/szn8otWI1iNFWz2mhMRANRx Wu5rSZa6H6i92XbXVhb3tyXq4JOZhwnoRrbyzaWFUItkcGaa1ymfLYbVeV/DERn2DJT2 ompopWEiLpPqmoemV2RQgnIfRsPFXSUdbg/VQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691308895; x=1691913695; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ljClwd6RT0VtKU2pAa16ata/SJq7/BZombob/nsC6kk=; b=W8ZgEU/fSJ/CflDvVi/n7K0u0d5IhJpGvHdJIuU7sbxMDPA4kaeqGqK5NNqspbk0aG qdpk6tTDtaI8sbyM5f7f6ER1HLOVHCi5UNQ5SCwTlll1pAF7bcd2qn/HFsJB4u/u0iLM 5Kna2QsVNSL/IT9OfCP0XdPnlWb8CaX5vgT62v3w8CKCe3JmtC8wP2JfbunRB+Rd9Hbl 3ShAEXee7EUZzUSL/jkQojZIgg+e6InDfy2rCPQQxIX324C1v+1CfQaDLNsGffb9lwMw wSemzA5sXj37aI4u3AAuTvDebFmEwdzXn5Q1gYAEXaelnGSLUFWrtZtxmB06EWbSoxqo fzBQ== X-Gm-Message-State: AOJu0Yx/aMtu9Nf1UVumBSMejTBADJfQrZkx/UfPPDR+goQwGu1QvJC4 O0sFPY1EgaR9KhgFNk2veo08ov1InpjEM91ivfo= X-Google-Smtp-Source: AGHT+IEKoTQ41PeFPc6czK0fwvxDftxPj7+ItoJtas5HsjxycKoLjsRFry7UMG1RbvFOLOOxn6j4Wg== X-Received: by 2002:a05:6000:11d2:b0:314:34dd:aaec with SMTP id i18-20020a05600011d200b0031434ddaaecmr3733553wrx.8.1691308895485; Sun, 06 Aug 2023 01:01:35 -0700 (PDT) Received: from Legionbuntu.. ([2a01:c846:10c0:200:9bf4:d5f:8c8:5ad6]) by smtp.gmail.com with ESMTPSA id u7-20020a5d5147000000b0031437ec7ec1sm6974156wrt.2.2023.08.06.01.01.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Aug 2023 01:01:35 -0700 (PDT) From: Simon Mikuda To: linux-bluetooth@vger.kernel.org Cc: Simon Mikuda Subject: [PATCH BlueZ 1/2] error: Add "Invalid exchange" mapping Date: Sun, 6 Aug 2023 10:01:08 +0200 Message-Id: <20230806080109.1639693-2-simon.mikuda@streamunlimited.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230806080109.1639693-1-simon.mikuda@streamunlimited.com> References: <20230806080109.1639693-1-simon.mikuda@streamunlimited.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This error is returned on this event: > HCI Event: Auth Complete (0x06) plen 3 Status: PIN or Key Missing (0x06) Handle: 11 Address: 00:00:00:00:00:00 (OUI 00-00-00) --- src/error.c | 4 ++++ src/error.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/error.c b/src/error.c index 29c071067..f179e6cda 100644 --- a/src/error.c +++ b/src/error.c @@ -171,6 +171,8 @@ const char *btd_error_bredr_conn_from_errno(int errno_code) return ERR_BREDR_CONN_ABORT_BY_LOCAL; case EPROTO: return ERR_BREDR_CONN_LMP_PROTO_ERROR; + case EBADE: + return ERR_BREDR_CONN_KEY_MISSING; default: return ERR_BREDR_CONN_UNKNOWN; } @@ -209,6 +211,8 @@ const char *btd_error_le_conn_from_errno(int errno_code) return ERR_LE_CONN_ABORT_BY_LOCAL; case EPROTO: return ERR_LE_CONN_LL_PROTO_ERROR; + case EBADE: + return ERR_LE_CONN_KEY_MISSING; default: return ERR_LE_CONN_UNKNOWN; } diff --git a/src/error.h b/src/error.h index cc7790a23..83206cb48 100644 --- a/src/error.h +++ b/src/error.h @@ -43,6 +43,7 @@ #define ERR_BREDR_CONN_LMP_PROTO_ERROR "br-connection-lmp-protocol-"\ "error" #define ERR_BREDR_CONN_CANCELED "br-connection-canceled" +#define ERR_BREDR_CONN_KEY_MISSING "br-connection-key-missing" #define ERR_BREDR_CONN_UNKNOWN "br-connection-unknown" /* LE connection failure reasons */ @@ -63,6 +64,7 @@ #define ERR_LE_CONN_LL_PROTO_ERROR "le-connection-link-layer-protocol-"\ "error" #define ERR_LE_CONN_GATT_BROWSE "le-connection-gatt-browsing" +#define ERR_LE_CONN_KEY_MISSING "le-connection-key-missing" #define ERR_LE_CONN_UNKNOWN "le-connection-unknown" DBusMessage *btd_error_invalid_args(DBusMessage *msg); From patchwork Sun Aug 6 08:01:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Mikuda X-Patchwork-Id: 712438 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0FFDFC04A6A for ; Sun, 6 Aug 2023 08:01:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229589AbjHFIBo (ORCPT ); Sun, 6 Aug 2023 04:01:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbjHFIBl (ORCPT ); Sun, 6 Aug 2023 04:01:41 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EFA71FCC for ; Sun, 6 Aug 2023 01:01:38 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3177f520802so2725419f8f.1 for ; Sun, 06 Aug 2023 01:01:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=streamunlimited.com; s=google; t=1691308896; x=1691913696; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=77Mvt05gb9c+2goFK08hoFzaMNPAPjt0DdNSyr1zw3g=; b=BuySFiMbcuTQEODH2U5PZLqTIOlX1pJN5cmxComb7Vlj0bjHkz1Y0O8bB7QuLXcnNw QRvkavuea2RQ+NtjSe6jOdmW6Ijqlm2SOfCqaueeNpTDxuC/qrUhG3kzbWHCYTwNvXLH zV/3Dlv48QOCKDhZI/eraniRrKCgwOP+Y9e2E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691308896; x=1691913696; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=77Mvt05gb9c+2goFK08hoFzaMNPAPjt0DdNSyr1zw3g=; b=HgyjPapUsUEQhhg4L/AeWcDlfGcBmK+xKw85FNg9rCFC+o0k5J8g9Icgv8uS5x7UHQ AhjNAgODI7+96obJvNMEkQVTkhKMdVwRE07VpjznPlGBGVAiOQrkIcsNPk1ouwl/D0ta F3BpQm1VFQ03kszJ74zZz4OnfAg1YCu9mxj6aykc3vWm+VMlWuX8fBMGIHrSn9OE9KK8 s4Ol2oCipFFPowlq3b350UgWqtK+X+zbMimnURs6C95YPAyiGegI4IQgXI6X1+5LXIU9 s1w+fh9kfsgHzJWG21fMxoOgQaFJfbPwEzAomTTJuXlobcZ+61kYyPW1ezQD70kdBXrX CJNA== X-Gm-Message-State: AOJu0YzyAxUCfNuGVqpVxythsTrqFNG5oPuKN5Wy3A5YSmLBdOnAVXeQ P+EjwCFYKFXTAZZ4OIWl2DpYGBv0oS4aWnOa3wU= X-Google-Smtp-Source: AGHT+IGMGs5nsXZs4mQU0oloX3jEwiSlGuC1eOtM1aicGwpiEl3NSatcrvtpy2G5qMPDNvqdxuS+Mw== X-Received: by 2002:adf:dfd2:0:b0:316:f9f1:bb0f with SMTP id q18-20020adfdfd2000000b00316f9f1bb0fmr3107906wrn.34.1691308896448; Sun, 06 Aug 2023 01:01:36 -0700 (PDT) Received: from Legionbuntu.. ([2a01:c846:10c0:200:9bf4:d5f:8c8:5ad6]) by smtp.gmail.com with ESMTPSA id u7-20020a5d5147000000b0031437ec7ec1sm6974156wrt.2.2023.08.06.01.01.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Aug 2023 01:01:35 -0700 (PDT) From: Simon Mikuda To: linux-bluetooth@vger.kernel.org Cc: Simon Mikuda Subject: [PATCH BlueZ 2/2] a2dp: Expose "Key missing" error Date: Sun, 6 Aug 2023 10:01:09 +0200 Message-Id: <20230806080109.1639693-3-simon.mikuda@streamunlimited.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230806080109.1639693-1-simon.mikuda@streamunlimited.com> References: <20230806080109.1639693-1-simon.mikuda@streamunlimited.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This error is not expected and retries will likely end up with same error. --- profiles/audio/a2dp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c index 47b5dd7c3..b43161a13 100644 --- a/profiles/audio/a2dp.c +++ b/profiles/audio/a2dp.c @@ -307,6 +307,7 @@ static int error_to_errno(struct avdtp_error *err) switch (perr) { case EHOSTDOWN: case ECONNABORTED: + case EBADE: return -perr; default: /*