]> The Tcpdump Group git mirrors - libpcap/commitdiff
Bluetooth: Fix interface initialization
authorMichal Labedzki <[email protected]>
Mon, 25 Mar 2013 10:36:49 +0000 (11:36 +0100)
committerMichal Labedzki <[email protected]>
Mon, 25 Mar 2013 10:36:49 +0000 (11:36 +0100)
There is a missing field to fill to get Bluetooth to work.

pcap-bt-linux.c

index c951a7e2d70e660684caa3d1447cc081fa9ce775..597aa6bbd9389279f3b10c6c437f1c14f320dcde 100644 (file)
@@ -78,7 +78,7 @@ bt_findalldevs(pcap_if_t **alldevsp, char *err_str)
        struct hci_dev_req *dev_req;
        int i, sock;
        int ret = 0;
-       
+
        sock  = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI);
        if (sock < 0)
        {
@@ -254,6 +254,7 @@ bt_activate(pcap_t* handle)
        /* Bind socket to the HCI device */
        addr.hci_family = AF_BLUETOOTH;
        addr.hci_dev = handle->md.ifindex;
+       addr.hci_channel = HCI_CHANNEL_RAW;
        if (bind(handle->fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
                snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
                    "Can't attach to device %d: %s", handle->md.ifindex,