From owner-freebsd-bluetooth@FreeBSD.ORG Wed Mar 25 15:16:30 2015 Return-Path: Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7ED8FD94 for ; Wed, 25 Mar 2015 15:16:30 +0000 (UTC) Received: from mail-ig0-x22e.google.com (mail-ig0-x22e.google.com [IPv6:2607:f8b0:4001:c05::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 36BED2AA for ; Wed, 25 Mar 2015 15:16:30 +0000 (UTC) Received: by igcxg11 with SMTP id xg11so28366556igc.0 for ; Wed, 25 Mar 2015 08:16:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=kPgaWOyY+T1MsoLboM4NXK7UeSx/CkX1PsURgOG06x0=; b=WL5sxKvM9pxA9+VrOtSM5nsY0m4ESQ5SZNj21AyO8JkCEcyhCDLC/nc4GHjpXx2jzQ Nzhe3mZE4cmqgelGUUm3DtJQZJwq+RLuKgXVepZv0OacnqBuXTWnCHbTX+P4755DZ+ir NYWhRAQrIr1rWIrzh/xuLkzunAg0MKU4H7MZAInrllbwrj7NckJL6UX/WFZEKTIwfz1V 8Kh3IvoztCUwqqbU9RQzhvYGu6j2VAdbx5taMBSqti7eAfOtHqeYXN6vSoyNaqjkSkJW mlSi8uC8+eJ6RXOFtYL2wvV2I7acBNJ8H/V6I5gXcdUyg27WrGq4Ewc3i/3KuZUwDJZE nTag== MIME-Version: 1.0 X-Received: by 10.42.89.200 with SMTP id h8mr18365126icm.48.1427296589647; Wed, 25 Mar 2015 08:16:29 -0700 (PDT) Received: by 10.36.66.74 with HTTP; Wed, 25 Mar 2015 08:16:29 -0700 (PDT) In-Reply-To: References: <0AD7A2F7-37BE-4F6A-9FD6-F6C81B2CAF36@gmail.com> Date: Wed, 25 Mar 2015 08:16:29 -0700 Message-ID: Subject: Re: register HID with SDP error From: Maksim Yevmenkin To: Waitman Gobble Content-Type: text/plain; charset=UTF-8 Cc: "freebsd-bluetooth@freebsd.org" , Iain Hibbert X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Mar 2015 15:16:30 -0000 Hello, sorry for the delay... > Through trial and error I found that this code is preventing the > response to the 0x0100 (L2CAP) query. > > in sdpd/ssar.c around line 230 or so. > > if (memcmp(&uuid, &puuid, sizeof(uuid)) != 0 && > memcmp(&uuid, &uuid_public_browse_group, sizeof(uuid)) != 0) > continue; right. this is to match uuid from the request with the uuid of registered services, or, special case, uuid for public browse group that is expected to return everything that is public. > When I comment that code out then it responds to the request with the > list of registered and advertised services and my clients then > magically connect. well, that's plain just wrong. you completely disabled any filtering. basically request for any uuid will return everything. including things that client has not asked for. the correct way is to add a list of addition uuid's (such as l2cap uuid) to every profile that should be checked as well. when client makes request for l2cap uuid it effectively asking to give back everything that "runs over l2cap". > Can you please explain the purpose of that code so I can fully > understand what I'm commenting out of the provider lookup loop in > sdpd/ssar.c ? please read above. also please read SDP spec, particularly part that talks about Service Search Request and Service Search Attribute Request. thanks max