public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Tetsuo Shiraishi <tetsu@s-direct.com>
Cc: BlueZ Mailing List <bluez-devel@lists.sourceforge.net>
Subject: Re: [Bluez-devel] rfcomm bind : Address already in use
Date: Fri, 09 Jul 2004 20:13:11 +0200	[thread overview]
Message-ID: <1089396790.22528.6.camel@pegasus> (raw)
In-Reply-To: <4.3.2-J.20040709223728.06828b80@emi.s-direct.com>

Hi Tetsuo,

> I'm developing an application waiting for a RFCOMM connection, like following.
> 
> - socket()
> - bind()
> - listen()
> - accept()
>     :
>     :
> 
> I'm in trouble that bind() function fails saying "Address already in use".
> 
> It occurs when waiting for RFCOMM connection from an only special corrupt peer
> once in awhile.
> It works fine to accept from almost peers using bluez, widcomm(for 
> windows)and etc.
> 
> The special corrupt peer sends RFCOMM frames like following sequence.
> (I attached the hcidump log)
> 
>  - RFCOMM_SABM
>  - RFCOMM_PN
>  - RFCOMM_DISC
>  - RFCOMM_DISC
>  - RFCOMM_DISC
>         :
>       repeat
>         :
> 
> Of course, it cannot establish a RFCOMM connection, so I disconnect the ACL
> connection using hcitool utility manually.
> 
> And then I terminate the application, and see /proc/bluetooth/rfcomm information.
> 
> ~ # cat /proc/bluetooth/rfcomm
> sk  E6:D7:1E:96:A0:00 F3:78:51:CF:07:00 9 1
> 
> Is it a garbage ???
> (Probably this causes me the trouble...)
> 
> And I start the application, then the application fails to do bind() 
> saying "Address already in use".
> 
> So I need to reboot...
> 
> I'm working to avoid rebooting in that matter, but cannot find a key to 
> solve it yet.

what kind of peer is this? Why don't you try to fix the problem in the
peer device? The BlueZ RFCOMM part is working correct.

The left over socket you see in /proc is from your application and it is
in the closed state. Do you really terminate your application? Try to
repdroduce this with rctest.

Regards

Marcel




-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

  reply	other threads:[~2004-07-09 18:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-09 17:21 [Bluez-devel] rfcomm bind : Address already in use Tetsuo Shiraishi
2004-07-09 18:13 ` Marcel Holtmann [this message]
2004-07-10 14:11   ` Tetsuo Shiraishi
2004-07-10 17:41     ` Marcel Holtmann
2004-07-12 17:16       ` Tetsuo Shiraishi
2004-07-12 18:26         ` Marcel Holtmann
2004-07-14  9:12           ` Tetsuo Shiraishi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1089396790.22528.6.camel@pegasus \
    --to=marcel@holtmann.org \
    --cc=bluez-devel@lists.sourceforge.net \
    --cc=tetsu@s-direct.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox