Skip to content

Commit

Permalink
libpcap 1.8.0 reports "All USB buses" device with "Bus ID 0"
Browse files Browse the repository at this point in the history
Do not complain that it carries packets that belong to other buses:
commit 003600f9
    Include usbmon0 in the list of known devices, if it's supported.
  • Loading branch information
g0tar committed Oct 28, 2017
1 parent 22730b0 commit 5f554fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/usb_bus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void usbtop::UsbBus::push(const pcap_pkthdr* h, const u_char* bytes)
const uint8_t device_id = bytes[11];
const uint16_t bus_id = *((const uint16_t*) &bytes[12]);

if (bus_id != id()) {
if ((bus_id != id()) && id()) {
std::cerr << "[bad packet] on bus " << id() << ", captured a packet claimed to be on bus " << bus_id << "." << std::endl;
return;
}
Expand Down

0 comments on commit 5f554fb

Please sign in to comment.