From patchwork Thu Jun 1 23:33:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 690319 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 42377C77B7A for ; Thu, 1 Jun 2023 23:33:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232583AbjFAXdZ (ORCPT ); Thu, 1 Jun 2023 19:33:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232674AbjFAXdW (ORCPT ); Thu, 1 Jun 2023 19:33:22 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21EEB189 for ; Thu, 1 Jun 2023 16:33:20 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1b010338d82so8574565ad.0 for ; Thu, 01 Jun 2023 16:33:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685662399; x=1688254399; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=y0c4SjY8Vrb88l5DL8d5i62OqpQ8IbLKYgBK1H7pEeU=; b=McQImibNKacStuD/heEryN4927kYnI7uHPnEjaIyJUxw/UC8uDjO7H4j2K+GYjUSrL r8MGKZrhEkC29dY89R3Ukt8aqMVisnEVoeB4n/zueF/EbFnYF1Aor+s7Jo3QgQvIAolf O1zf15IOPuT315S+u1+C521SfzMNgRsIcxVYpYM/7Cb9mIACWHLuS5nKUHBCsA8pN5/O Jacek6mtnHr8Z1LYflvouX6lezYwKcuTeuwb2MDcsrtzYrG90QRLHL9SB1hOe60CVUwt 4RwoXUUXsJojUM7D4hcabl8BsUZ2upTn8y4TWSKJ25XLXzeygnExyeTpgbZpunq7SO45 2nOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685662399; x=1688254399; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=y0c4SjY8Vrb88l5DL8d5i62OqpQ8IbLKYgBK1H7pEeU=; b=l0W3X9+eQSOO4FHPTQj6veTfHNZU7D3EXL9sFLXCG4Gdj/Zd0X6YpAY9XjC5vvqkGy sxTU8N8dBKZnwxWzZURAf62CORqJNZqMQWsA3LnHPbj5kgvQcvMkzzFNeQxbOW3vCQ6q 08dPg+pPLDdVJtbqFsdP0cDDPNGLNEbTv5c6F2WkGOPSF7TYLOtnrmVY5JHzFYwA8NKw vcPTDecnMoGoAb2lvIkTlDe5mYE5C5giyr3SUzZN6Cc0qCWWKuyTBzwOXOxPH+TD8mvg lYoyVG5pkOgiYfpVBrdXKIa49urcwjuDO8cOZq8lwOK+oBtWubUGIRL5H9eQ5PH0V1y0 IWLg== X-Gm-Message-State: AC+VfDx6RFipLos8m+rp+5WijFcPzHSzF3DuFZXQWTYcbaxHwMSxJU7d hVzQav8t9zVS9F21CZ/vbW8xScPhrSs= X-Google-Smtp-Source: ACHHUZ4BfLBgaQmvxzZnddSxXgoTeiYYBClZH+w3WkgfpWEr4+5/yw3p1/VcVC4Ce14oH/YKEKGLVw== X-Received: by 2002:a17:903:11d1:b0:1ac:b363:83a6 with SMTP id q17-20020a17090311d100b001acb36383a6mr782876plh.17.1685662398720; Thu, 01 Jun 2023 16:33:18 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-59-129-171.hsd1.or.comcast.net. [71.59.129.171]) by smtp.gmail.com with ESMTPSA id s7-20020a170902a50700b001ab0b2dad2fsm4051420plq.211.2023.06.01.16.33.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 16:33:18 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ 1/2] monitor: Only print credentials if PID is set Date: Thu, 1 Jun 2023 16:33:16 -0700 Message-Id: <20230601233317.1419030-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz If PID is not set don't print anything since this is likely a packet originated by the kernel itself. --- monitor/packet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitor/packet.c b/monitor/packet.c index 946ceb2c640d..6d73e5abfcbc 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -438,7 +438,7 @@ static void print_packet(struct timeval *tv, struct ucred *cred, char ident, pos += n; } - if (cred) { + if (cred && cred->pid) { cred_pid(cred, pid_str, sizeof(pid_str)); n = sprintf(line + pos, "%s: %c %s", pid_str, ident, label ? label : ""); From patchwork Thu Jun 1 23:33:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 687839 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 BB9FFC7EE29 for ; Thu, 1 Jun 2023 23:33:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231600AbjFAXd0 (ORCPT ); Thu, 1 Jun 2023 19:33:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232772AbjFAXdX (ORCPT ); Thu, 1 Jun 2023 19:33:23 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD5431A1 for ; Thu, 1 Jun 2023 16:33:21 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1b1806264e9so8811695ad.0 for ; Thu, 01 Jun 2023 16:33:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685662400; x=1688254400; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=dSCV8BxOlg0I7DIlrGZCljWyg/rOkqmB/KoboSuxCjc=; b=mPpuwpVjy6uU471KBZDgykTjz90AgdiqN0r+Ql7kCk2iIABvof3/XTuVm/dM0kNiEb hC9BqOEADvYiJTB2s0u74mHp/qT+INAtqrT0NiSi7+P+rIwmToAuPovDpSxftW1dvgEW HJ0gzRciihl6sFR0OYI7RmfxGhxTHAeExK+8iZUkSM6CCkLu/rShfn2+RyUbM+une/bZ PQ02cGIS15vflQzrfWfPKcf4FDVJQCdDPDgpes3/kSfdq5eUbqSk8L7+8Ob0NCN6phby 6bnMd+W2zYScYFc8hNlS39wH8VoYR0LQeqDhbpC0Mz57QeNnsXmgmPxYqNpphdnx+mlI p8gA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685662400; x=1688254400; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dSCV8BxOlg0I7DIlrGZCljWyg/rOkqmB/KoboSuxCjc=; b=C7p5qwGsSOO8kTdqd1qqhJiX9svxwJ7hn5D+vx9xBHuaTe79XFTM5RnS8cRkVQCWxE I8BbKn/PNd3m6TLMbloE7X2v1xUbbK0uORCAHn3Mu+6lanS6dykxbZ8k97n4141xO/oP s4vlbXju/yzM4kTllaHK7/yCg49K9kcmGsRkSs1takubdSSBiy7dp+IjMPgxzQiR12MR VOfWKPB/jF1MUNU2s2XBjCOyjFZwS5iG8b4sgFrVt3ulxGPckcYyBydpb7k2DxWuouL0 fOLI7IgPTuSrnC/tGAgp7+OtNwhRrR/Jjg5J6RuqTvlajEAH2dfJ/KIE66uYmQNVgt5t 99uQ== X-Gm-Message-State: AC+VfDygNQ/tMOkR4rYCZZdNAjwWxLgwWzfxa6V0psHlier6EkUwxTBs FsLXak9wRLJd6S+YiZjicN3y/e8LZEk= X-Google-Smtp-Source: ACHHUZ4xnPnuzvv8UVfB+iDA2IEuCpci/U2huBHPHL/6KHuEmiueS6GGvCKYXqh1Whtz4UEhPKkwaQ== X-Received: by 2002:a17:902:8697:b0:1a1:a800:96a7 with SMTP id g23-20020a170902869700b001a1a80096a7mr734364plo.8.1685662400321; Thu, 01 Jun 2023 16:33:20 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-59-129-171.hsd1.or.comcast.net. [71.59.129.171]) by smtp.gmail.com with ESMTPSA id s7-20020a170902a50700b001ab0b2dad2fsm4051420plq.211.2023.06.01.16.33.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 16:33:19 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ 2/2] shared/bap: Don't overwrite attribute declaration Date: Thu, 1 Jun 2023 16:33:17 -0700 Message-Id: <20230601233317.1419030-2-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230601233317.1419030-1-luiz.dentz@gmail.com> References: <20230601233317.1419030-1-luiz.dentz@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz The attribute declaration (e.g. characteristic properties) shall not be overwritten as they are part of the information that is part of the cache beside the same information is already stored as part of the bt_bap instance. --- src/shared/bap.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/shared/bap.c b/src/shared/bap.c index 26f41be768e9..86c2634472fb 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -3077,9 +3077,6 @@ static void read_source_pac_loc(bool success, uint8_t att_ecode, pacs->source_loc_value = get_le32(value); - gatt_db_attribute_write(pacs->source_loc, 0, value, length, 0, NULL, - NULL, NULL); - /* Resume reading sinks if supported but for some reason is empty */ if (pacs->source && queue_isempty(bap->rdb->sources)) { uint16_t value_handle; @@ -3113,9 +3110,6 @@ static void read_sink_pac_loc(bool success, uint8_t att_ecode, pacs->sink_loc_value = get_le32(value); - gatt_db_attribute_write(pacs->sink_loc, 0, value, length, 0, NULL, - NULL, NULL); - /* Resume reading sinks if supported but for some reason is empty */ if (pacs->sink && queue_isempty(bap->rdb->sinks)) { uint16_t value_handle; @@ -3149,9 +3143,6 @@ static void read_pac_context(bool success, uint8_t att_ecode, pacs->sink_context_value = le16_to_cpu(ctx->snk); pacs->source_context_value = le16_to_cpu(ctx->src); - - gatt_db_attribute_write(pacs->context, 0, value, length, 0, NULL, - NULL, NULL); } static void read_pac_supported_context(bool success, uint8_t att_ecode, @@ -3175,9 +3166,6 @@ static void read_pac_supported_context(bool success, uint8_t att_ecode, pacs->supported_sink_context_value = le16_to_cpu(ctx->snk); pacs->supported_source_context_value = le16_to_cpu(ctx->src); - - gatt_db_attribute_write(pacs->supported_context, 0, value, length, 0, - NULL, NULL, NULL); } static void foreach_pacs_char(struct gatt_db_attribute *attr, void *user_data)