Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1363603rwl; Wed, 5 Apr 2023 16:14:17 -0700 (PDT) X-Google-Smtp-Source: AKy350Z/kbHWGiD0sXVS1Qsk1BH/tMxAwdPTKBsPCQ/AqpO16UPHRwh3MgvvBk2+zTp5kWb0Z2TZ X-Received: by 2002:a17:907:8c0b:b0:93e:82d1:9ae3 with SMTP id ta11-20020a1709078c0b00b0093e82d19ae3mr4415223ejc.17.1680736457170; Wed, 05 Apr 2023 16:14:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680736457; cv=none; d=google.com; s=arc-20160816; b=JqH6wiZlMdlyhoddTvkee2+hyluJYmfAT41I/2JD9LUdf8ltqgqIQEOekeFT6QtDqo nHBG0IfDsUyAv0aTA0UPW0Q+NKlqnBhxERIvakI8nbW1eq8rmnXGdqqLvcy4PzqlS2Y4 yKLspnVoGWUrzrlpKVMvQWc2Pag5OnbK7E3jhMsEgDf88OCjOKk3T5HM+03F6rnnGrfo 8pMFX5ut5wf7T6fN7Xa+ROIdiGlHO9GHDnL64hzZ3Xnk1FnQJdA2D+aiY3YFk4k7djWd 7k+n+AdfIIdsn9mfrwOBdX38ZHK53wVx3vrHnASkzz8fOOFFmwzy/PeKWQqaHsT4C4Z/ cY0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=BTuVRoYIpyS9FYtg1FOjJUWJ8TECAJyoSu618nmDA/0=; b=m4QmsWccctsJ1BnHzpheCHWkD5KHmmemmZl56jPOKFyf1g26w2GeHWWXLDPjOTf3yW fWGffh/Kvtq/yI/V/NBh+o4wpZU4vQtY1XTgOmhu5lgE3ciXtx5yEvmJeSwH9RPszizz rTi7xoffzR5TyA3tSbA7m86U6GaCQMvPciBx/wWvpc/emLcaFekWKuZOfdK6YXHZi7PE bmq/M1uyv7CxR7z9EHA7g1aDntX+cYVP/p8qyVYXcJyWCjnhXnoCM7bSrw0mgAaZurd4 X9jMuwHMW/XokBBleLtKEGnEdmqMdO4dh8XNjX8Zg6MLNLEa0ZXtEbRu5g8WNgvsDcdn 58oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hDVgnRYy; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oy3-20020a170907104300b00942d332162asi3609161ejb.1021.2023.04.05.16.13.25; Wed, 05 Apr 2023 16:14:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hDVgnRYy; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229737AbjDEXLR (ORCPT + 99 others); Wed, 5 Apr 2023 19:11:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229481AbjDEXLR (ORCPT ); Wed, 5 Apr 2023 19:11:17 -0400 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DD746A7A for ; Wed, 5 Apr 2023 16:11:15 -0700 (PDT) Received: by mail-pg1-x532.google.com with SMTP id d8so22740951pgm.3 for ; Wed, 05 Apr 2023 16:11:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680736274; 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=BTuVRoYIpyS9FYtg1FOjJUWJ8TECAJyoSu618nmDA/0=; b=hDVgnRYy43qgTyMXQ4ixA94esSsdwSqN4cpawCtXk5rdzdTi3R0GozPHodXf8xbkRo jPh+K6138Qq8EChetMFZPP1bVsJpfhlkpjEyaK47erBgzcc7pFUYHOL4YHj9XM2KN5pW 4lEbDVe33ouEQBlQeP3W++fTPgNhRsnj8NRnqrIjkDjS+1XAKWmpU3oii+QN1KGpOXt9 k4gsDoMd9diYqyL6cf7wy50reJCgfhWSyZGXp8UrXZ09lgOdgJ+bphGReJ7sU6zQ7n0N SVG2gXG/iqF3H7S4j0wBnyf6NESwmjWzz9OibujkRPyhKu+01WOQ0LmVgFQ/4/M4UaQB sX7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680736274; 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=BTuVRoYIpyS9FYtg1FOjJUWJ8TECAJyoSu618nmDA/0=; b=D5GiW3QCCZmxoo+9lIcNkUYr3jvVPcM3z8ydkjAgDc/9HHZQvCSv8nXBc6Kzj3/I9S +LCku9FLQ5l7GH0udFzmWA0vYisCUA5SjsXAjDb30+ghprt0sNnF3Xd1R/r/84nL1i/7 ImFEtZMmhLmQKv28dAIEsMuwtnZYo6IxZmPOj6gV/yTR1mP9ST/omApHAtOZfX4ayP1l IFQ/jdFJvTvOVSfu6xo00ND8vR8396kIIAw+rm54wtJBGxziQ8Z2SNANflKQIvnc5Aa2 NjRfMmzuhVbQmH5n5rokjx8MdyNBO1I7jj80jkQ86M+EBCx2OTIIgXy6XcYSzf6ddrZ5 4jyQ== X-Gm-Message-State: AAQBX9cRKi/guYWYFs+p3EjcAY63E+cWIQWILmq0Fw46MVZC9AkiHM1r jgZHYSd5wXXG8VJWUOwjtZi0ErCE9gg= X-Received: by 2002:a05:6a00:8f:b0:627:ee6a:2a40 with SMTP id c15-20020a056a00008f00b00627ee6a2a40mr7726519pfj.10.1680736274529; Wed, 05 Apr 2023 16:11:14 -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 v12-20020aa7808c000000b006254794d5b2sm11537752pff.94.2023.04.05.16.11.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 16:11:13 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ 2/5] shared/ad: Fix bt_ad_has_data not matching when only type is passed Date: Wed, 5 Apr 2023 16:11:08 -0700 Message-Id: <20230405231111.2636523-2-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230405231111.2636523-1-luiz.dentz@gmail.com> References: <20230405231111.2636523-1-luiz.dentz@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz bt_ad_has_data attempts to match the data portion even when not set which is useful the user is only interested in actually mataching the type alone. --- src/shared/ad.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/shared/ad.c b/src/shared/ad.c index 27b76dc8179b..7350aa206d1e 100644 --- a/src/shared/ad.c +++ b/src/shared/ad.c @@ -1028,6 +1028,9 @@ static bool data_match(const void *data, const void *user_data) if (d1->type != d2->type) return false; + if (!d2->len && !d2->data) + return true; + if (d1->len != d2->len) return false; -- 2.39.2