the-tcpdump-group/libpcap — pull request #322 by oxplot (2013-09-29 10:43:56+00:00)
Title: Bluetooth devices not available for capture

Trying to capture from my bluetooth with wireshark, I couldn't find my adapter. Here is what I got when running `dumpcap -D` under root user:

1. usbmon1
2. usbmon2
3. usbmon3
4. usbmon4
5. p5p1
6. p6p1
7. any
8. lo (Loopback)

Digged in and turns out that `add_or_find_if()` in `inet.c` adds my bluetooth adapter to top of the list based on its rules. But `bt_findalldevs()` in `pcap-bt-linux.c` doesn't update `alldevsp` so the caller cannot see the added item. The only way `bt_findalldevs()` would work is if the bluetooth adapters are added to the list somewhere below the first item. And I assume in tests, this has been the case to date (as the source code seem to have been the same for past 7 years).

I have done a smoke test of running `dumpcap` and the wireshark GUI with this patch to capture HCI packets and it works fine.