All of lore.kernel.org
 help / color / mirror / Atom feed
* l2ping Recv failed: Connection reset by peer
@ 2012-07-31 21:12 Charles Gordon
  2012-07-31 22:33 ` Vinicius Costa Gomes
  2012-08-07 21:01 ` Mike
  0 siblings, 2 replies; 3+ messages in thread
From: Charles Gordon @ 2012-07-31 21:12 UTC (permalink / raw)
  To: linux-bluetooth

Hi,

I'm porting bluez 4.98 to an embedded system.  I have it up and running, but
I notice that when I run l2ping, I get the message "Recv failed: Connection
reset by peer" after l2ping runs for 5 seconds.  This is very consistent.
It doesn't matter whether I ping once a second, or do a flood ping.  After 5
seconds the l2ping program closes with the message saying the connection was
reset by the peer.

This looks like some sort of timeout.  Perhaps the timeout is there for
security reasons.  I'd like to understand how to adjust the timeout, or at
least confirm that the system is working correctly.

I'm running Linux 2.6.35 and Bluez 4.98 on my embedded system, and Ubuntu
10.04 with Linux 2.6.32 and Bluez 4.60 on my PC.

I've looked through the Bluez configuration files and I don't see anything
that sets up security for L2CAP or sets timeouts that are relevant.  I tried
increasing the PageTimeout in /etc/bluetooth/main.conf to 81920 (50 seconds)
on both systems, but that didn't make any difference.  I also looked in the
configuration program hciconfig for an option to set a timeout, but I didn't
find anything.

Can anyone tell me what the relevant timeout for l2ping is and how to adjust
it, or at least why it is set for 5 seconds?

Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: l2ping Recv failed: Connection reset by peer
  2012-07-31 21:12 l2ping Recv failed: Connection reset by peer Charles Gordon
@ 2012-07-31 22:33 ` Vinicius Costa Gomes
  2012-08-07 21:01 ` Mike
  1 sibling, 0 replies; 3+ messages in thread
From: Vinicius Costa Gomes @ 2012-07-31 22:33 UTC (permalink / raw)
  To: Charles Gordon; +Cc: linux-bluetooth

Hi Charles,

On 17:12 Tue 31 Jul, Charles Gordon wrote:
> Hi,
> 
> I'm porting bluez 4.98 to an embedded system.  I have it up and running, but
> I notice that when I run l2ping, I get the message "Recv failed: Connection
> reset by peer" after l2ping runs for 5 seconds.  This is very consistent.
> It doesn't matter whether I ping once a second, or do a flood ping.  After 5
> seconds the l2ping program closes with the message saying the connection was
> reset by the peer.

If I run l2ping without parameters, I get this:

l2ping - L2CAP ping
Usage:
	l2ping [-i device] [-s size] [-c count] [-t timeout] [-d delay] [-f] [-r] [-v] <bdaddr>
	-f  Flood ping (delay = 0)
	-r  Reverse ping
	-v  Verify request and response payload

The '-t' option sounds promising.

But anyway, the default value for the timeout is 10 seconds. So I would like know
how would it behave with other values. Perhaps the remote side is disconnecting.

[snip]


Cheers,
-- 
Vinicius

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: l2ping Recv failed: Connection reset by peer
  2012-07-31 21:12 l2ping Recv failed: Connection reset by peer Charles Gordon
  2012-07-31 22:33 ` Vinicius Costa Gomes
@ 2012-08-07 21:01 ` Mike
  1 sibling, 0 replies; 3+ messages in thread
From: Mike @ 2012-08-07 21:01 UTC (permalink / raw)
  To: Charles Gordon; +Cc: linux-bluetooth

Hi Charles,

> I'm porting bluez 4.98 to an embedded system.  I have it up and running, but
> I notice that when I run l2ping, I get the message "Recv failed: Connection
> reset by peer" after l2ping runs for 5 seconds.  This is very consistent.
> It doesn't matter whether I ping once a second, or do a flood ping.  After 5
> seconds the l2ping program closes with the message saying the connection was
> reset by the peer.
>
> This looks like some sort of timeout.  Perhaps the timeout is there for
> security reasons.  I'd like to understand how to adjust the timeout, or at
> least confirm that the system is working correctly.
>
> I'm running Linux 2.6.35 and Bluez 4.98 on my embedded system, and Ubuntu
> 10.04 with Linux 2.6.32 and Bluez 4.60 on my PC.
>
> I've looked through the Bluez configuration files and I don't see anything
> that sets up security for L2CAP or sets timeouts that are relevant.  I tried
> increasing the PageTimeout in /etc/bluetooth/main.conf to 81920 (50 seconds)
> on both systems, but that didn't make any difference.  I also looked in the
> configuration program hciconfig for an option to set a timeout, but I didn't
> find anything.
>
> Can anyone tell me what the relevant timeout for l2ping is and how to adjust
> it, or at least why it is set for 5 seconds?

I have a feeling you're actually hitting a timeout inside the kernel.
This timer prevents devices from connecting and draining the battery
of your device.  So, unless the device connects to something "useful",
it gets disconnected.  It's been too long since I've looked at it, but
the timeouts are specified in "include/net/bluetooth/hci.h".  I have
seen the same l2ping issues you see, so I think your setup is working
as designed.

Mike

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-07 21:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-31 21:12 l2ping Recv failed: Connection reset by peer Charles Gordon
2012-07-31 22:33 ` Vinicius Costa Gomes
2012-08-07 21:01 ` Mike

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.