Qt: Fix filling bluetooth device address
When filling bd_addr from tap_device->bd_addr[], only the first octet was used Change-Id: I3cb281d96126d77e5e6862e44704c7f9ab34cb78 Reviewed-on: https://code.wireshark.org/review/36152 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
parent
d5ec6882fe
commit
c6411187a0
|
@ -395,9 +395,10 @@ tap_packet_status BluetoothDeviceDialog::tapPacket(void *tapinfo_ptr, packet_inf
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tap_device->has_bd_addr) {
|
if (tap_device->has_bd_addr) {
|
||||||
for (int i = 0; i < 6; ++i)
|
for (int i = 0; i < 6; ++i) {
|
||||||
bd_addr += QString("%1:").arg(tap_device->bd_addr[0], 2, 16, QChar('0'));
|
bd_addr += QString("%1:").arg(tap_device->bd_addr[i], 2, 16, QChar('0'));
|
||||||
bd_addr.remove(bd_addr.length() - 1, 1);
|
}
|
||||||
|
bd_addr.chop(1); // remove extra character ":" from the end of the string
|
||||||
if (!tap_device->is_local && bd_addr != tapinfo->bdAddr)
|
if (!tap_device->is_local && bd_addr != tapinfo->bdAddr)
|
||||||
return TAP_PACKET_REDRAW;
|
return TAP_PACKET_REDRAW;
|
||||||
|
|
||||||
|
|
|
@ -286,10 +286,10 @@ tap_packet_status BluetoothDevicesDialog::tapPacket(void *tapinfo_ptr, packet_in
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tap_device->has_bd_addr) {
|
if (tap_device->has_bd_addr) {
|
||||||
for (int i = 0; i < 6; ++i)
|
for (int i = 0; i < 6; ++i) {
|
||||||
bd_addr += QString("%1:").arg(tap_device->bd_addr[0], 2, 16, QChar('0'));
|
bd_addr += QString("%1:").arg(tap_device->bd_addr[i], 2, 16, QChar('0'));
|
||||||
bd_addr.remove(bd_addr.length() - 1, 1);
|
}
|
||||||
|
bd_addr.chop(1); // remove extra character ":" from the end of the string
|
||||||
manuf = get_ether_name(tap_device->bd_addr);
|
manuf = get_ether_name(tap_device->bd_addr);
|
||||||
if (manuf) {
|
if (manuf) {
|
||||||
int pos;
|
int pos;
|
||||||
|
|
Loading…
Reference in New Issue