Bluetooth: Fix to set proper bdaddr_type for RFCOMM connect
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Tue, 5 Nov 2013 08:15:42 +0000 (17:15 +0900)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>
Wed, 13 Nov 2013 13:36:53 +0000 (11:36 -0200)
L2CAP socket validates proper bdaddr_type for connect, so this
patch fixes to set explictly bdaddr_type for RFCOMM connect.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/rfcomm/core.c

index 292fa64..ce75211 100644 (file)
@@ -720,6 +720,7 @@ static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src,
        addr.l2_family = AF_BLUETOOTH;
        addr.l2_psm    = __constant_cpu_to_le16(RFCOMM_PSM);
        addr.l2_cid    = 0;
+       addr.l2_bdaddr_type = BDADDR_BREDR;
        *err = kernel_connect(sock, (struct sockaddr *) &addr, sizeof(addr), O_NONBLOCK);
        if (*err == 0 || *err == -EINPROGRESS)
                return s;