Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Oct 2012 09:56:18 +0100 (BST)
From:      Iain Hibbert <plunky@rya-online.net>
To:        Maksim Yevmenkin <maksim.yevmenkin@gmail.com>
Cc:        freebsd-bluetooth@freebsd.org, Andreas Longwitz <longwitz@incore.de>
Subject:   Re: btpand problem
Message-ID:  <alpine.NEB.2.00.1210120949170.628@galant.ukfsn.org>
In-Reply-To: <CAFPOs6pF51wy9PvKLn4-OnrOqo8hU1S=P5PzTFwgUppBjqAtuA@mail.gmail.com>
References:  <507736A8.4050605@incore.de> <BDA3CA14-92C0-414E-9D55-E96EA7A73312@gmail.com> <5077490F.7010901@incore.de> <CAFPOs6pF51wy9PvKLn4-OnrOqo8hU1S=P5PzTFwgUppBjqAtuA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 11 Oct 2012, Maksim Yevmenkin wrote:

> On Thu, Oct 11, 2012 at 3:32 PM, Andreas Longwitz <longwitz@incore.de> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.NEB.2.00.1210120949170.628>