Package: bluez
Version: 4.99-2
Severity: normal
Tags: patch

Please disable the pnat plugin. It breaks any application that tries to run an RFCOMM server. According to upstream:

There should be absolutely no reason for Ubuntu have this plugin enabled or even compiled. You might wanna file a bug to them to disable it. The only place where it makes sense to be compiled is in Nokia's Maemo Harmattan platform. For everything else it should be disabled (as it is by default).
    -- Johan Hedberg on the linux-bluetooth mailing list
    <http://www.spinics.net/lists/linux-bluetooth/msg14290.html>

The symptom is that when an RFCOMM client attempts to connect to a listening RFCOMM server:

- the client application sees "Connection reset by peer" when sending data;
- the server never sees the connection; and
- the following appears in the (Debian) server's syslog:

bluetoothd[6190]: Unable to spawn pnatd: Failed to execute child process "/usr/bin/phonet-at" (No such file or directory)

STEPS TO REPRODUCE:

1. Get two machines running Debian. One will be the server and the other will be the client.

2. On both machines, install python-bluez.

3. Find out the server's Bluetooth address (e.g. using "hcitool dev")

4. Pair the client and server.

5. On the server, run the following:

    cd /usr/share/doc/python-bluez/examples/simple/
    python rfcomm-server.py

6. On the client, run the following, using the server's address:

    cd /usr/share/doc/python-bluez/examples/simple/
    python rfcomm-client.py xx:xx:xx:xx:xx:xx

7. You should see this:

    Searching for SampleServer on xx:xx:xx:xx:xx:xx
    connecting to "SampleServer" on xx:xx:xx:xx:xx:xx
    connected.  type stuff

8. Type a few lines of text

What _should_ happen is that we should see something like this on the server:

    Waiting for connection on RFCOMM channel 1
    Accepted connection from  ('yy:yy:yy:yy:yy:yy', 1)
    received [asdf]
    received [asdf]
    received [azxvc]

What _actually_ happens is that we see nothing on the server, and we see the following on the client:

    Searching for SampleServer on xx:xx:xx:xx:xx:xx
    connecting to "SampleServer" on xx:xx:xx:xx:xx:xx
    connected.  type stuff
    asdf
    Traceback (most recent call last):
      File "rfcomm-client.py", line 43, in <module>
        sock.send(data)
      File "<string>", line 5, in send
    bluetooth.btcommon.BluetoothError: (104, 'Connection reset by peer')


The following patch fixes this bug:

---[ Begin patch ]---
diff --git a/debian/rules b/debian/rules
index c1bcccb..980f18a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -18,7 +18,6 @@ DEB_CONFIGURE_EXTRA_FLAGS := \
                             --enable-time \
                             --enable-alert \
                             --enable-health \
-                             --enable-pnat \
                             --enable-gatt-example \
                             --enable-gstreamer \
                             --enable-alsa \
---[ End patch ]---


A workaround is to add the following to /etc/bluetooth/main.conf:

   DisablePlugins = pnat

Cheers,
- Dwayne

-- System Information:
Debian Release: wheezy/sid
 APT prefers testing
 APT policy: (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: armel
i386

Kernel: Linux 3.2.0-3-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_CA.utf8, LC_CTYPE=en_CA.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages bluez depends on:
ii  dbus          1.6.0-1
ii  kmod          9-2
ii  libc6         2.13-35
ii  libcap-ng0    0.6.6-2
ii  libdbus-1-3   1.6.8-1
ii  libglib2.0-0  2.32.3-1
ii  libreadline6  6.2-8
ii  libudev0      175-7
ii  libusb-0.1-4  2:0.1.12-20
ii  lsb-base      4.1+Debian7
ii  python-dbus   1.1.1-1
ii  python-gi     3.2.2-1
ii  udev          175-7

bluez recommends no packages.

bluez suggests no packages.

-- no debconf information


--
Dwayne C. Litzenberger <dl...@dlitz.net>
 OpenPGP: 19E1 1FE8 B3CF F273 ED17  4A24 928C EC13 39C2 5CF7


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to