From owner-freebsd-bluetooth@FreeBSD.ORG Fri Oct 12 09:03:14 2012 Return-Path: Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 65EBF103 for ; Fri, 12 Oct 2012 09:03:14 +0000 (UTC) (envelope-from plunky@rya-online.net) Received: from smtpout.wanadoo.co.uk (smtpout2.wanadoo.co.uk [80.12.242.42]) by mx1.freebsd.org (Postfix) with ESMTP id CEE138FC0A for ; Fri, 12 Oct 2012 09:03:13 +0000 (UTC) Received: from galant.ukfsn.org ([109.249.208.208]) by mwinf5d30 with ME id A8vY1k0074WKEX9038vZhU; Fri, 12 Oct 2012 10:55:36 +0200 Received: by galant.ukfsn.org (Postfix, from userid 1000) id 36C852600A0; Fri, 12 Oct 2012 09:56:18 +0100 (BST) Date: Fri, 12 Oct 2012 09:56:18 +0100 (BST) From: Iain Hibbert To: Maksim Yevmenkin Subject: Re: btpand problem In-Reply-To: Message-ID: References: <507736A8.4050605@incore.de> <5077490F.7010901@incore.de> User-Agent: Alpine 2.00 (NEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-bluetooth@freebsd.org, Andreas Longwitz X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Oct 2012 09:03:14 -0000 On Thu, 11 Oct 2012, Maksim Yevmenkin wrote: > On Thu, Oct 11, 2012 at 3:32 PM, Andreas Longwitz wrote: > > Thanks for quick answer ! > > > >> Can you tell what l2cap Mtu was negotiated on both ends? > > > > HCIDump - HCI packet analyzer ver 1.5 > > ... > >> ACL data: handle 0x002a flags 0x02 dlen 18 > > L2CAP(s): Config rsp: scid 0x004f flags 0x0000 result 0 clen 4 > > MTU 672 > >> ACL data: handle 0x002a flags 0x02 dlen 16 > > L2CAP(s): Config req: dcid 0x004f flags 0x0000 clen 4 > > MTU 256 > > .... > > < ACL data: handle 0x002a flags 0x02 dlen 16 > > L2CAP(s): Config req: dcid 0x0203 flags 0x0000 clen 4 > > MTU 1691 > >> HCI Event: Number of Completed Packets(0x13) plen 5 > >> ACL data: handle 0x002a flags 0x02 dlen 18 > > L2CAP(s): Config rsp: scid 0x0050 flags 0x0000 result 0 clen 4 > > MTU 1691 > >> ACL data: handle 0x002a flags 0x02 dlen 16 > > L2CAP(s): Config req: dcid 0x0050 flags 0x0000 clen 4 > > MTU 1691 > > .... > > > > My panserver is an iPhone 4S in hotspot mode. Is this more than one connection, can you show the entire dump? (the first one is a rsp from the other side, then it sends a req later..?) > well, it looks like your device told btpand(8) that it can not accept > more than 672 bytes (default l2cap mtu) at a time. hence the emsgsize > error, i.e. datagram, btpand(8) is trying to send, is too big for > remote device to accept. quick fix would be to adjust mtu on the tap > interface to make sure btpand(8) never tries to send more than 672 > bytes of payload. except that client_init() requires that the negotiated outgoing MTU be at least the BNEP minimum MTU (1691), and bnep_send will fail if the packet is larger than the channel MTU .. Andreas, can you add some debug to the end of bnep_send() something like if (nw == -1) { uint16_t mtu; socklen_t len = sizeof(mtu); getsockopt(fd, BTPROTO_L2CAP, SO_L2CAP_OMTU, &mtu, &len); log_err("writev failed: %m (mtu %d)\n", mtu); } ? iain