forked from osmocom/wireshark
Bluetooth: Fix conflicting address fields
For Broadcast address use FT_ETHER with FF:FF:FF:FF:FF:FF address instead of string address "Broadcast". Change-Id: I638d3d6a1baa9c965dd0a9f548cedbd81af3ec5b Reviewed-on: https://code.wireshark.org/review/14767 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
This commit is contained in:
parent
eff5e0b286
commit
03cc477357
|
@ -45,9 +45,9 @@ int proto_bluetooth = -1;
|
|||
static int hf_bluetooth_src = -1;
|
||||
static int hf_bluetooth_dst = -1;
|
||||
static int hf_bluetooth_addr = -1;
|
||||
static int hf_bluetooth_str_src = -1;
|
||||
static int hf_bluetooth_str_dst = -1;
|
||||
static int hf_bluetooth_str_addr = -1;
|
||||
static int hf_bluetooth_src_str = -1;
|
||||
static int hf_bluetooth_dst_str = -1;
|
||||
static int hf_bluetooth_addr_str = -1;
|
||||
|
||||
static int hf_llc_bluetooth_pid = -1;
|
||||
|
||||
|
@ -1546,16 +1546,28 @@ save_local_device_name_from_eir_ad(tvbuff_t *tvb, gint offset, packet_info *pinf
|
|||
}
|
||||
|
||||
|
||||
static const char* bluetooth_conv_get_filter_type(conv_item_t* conv _U_, conv_filter_type_e filter)
|
||||
static const char* bluetooth_conv_get_filter_type(conv_item_t* conv, conv_filter_type_e filter)
|
||||
{
|
||||
if (filter == CONV_FT_SRC_ADDRESS)
|
||||
return "bluetooth.src";
|
||||
if (filter == CONV_FT_SRC_ADDRESS) {
|
||||
if (conv->src_address.type == AT_ETHER)
|
||||
return "bluetooth.src";
|
||||
else if (conv->src_address.type == AT_STRINGZ)
|
||||
return "bluetooth.src_str";
|
||||
}
|
||||
|
||||
if (filter == CONV_FT_DST_ADDRESS)
|
||||
return "bluetooth.dst";
|
||||
if (filter == CONV_FT_DST_ADDRESS) {
|
||||
if (conv->dst_address.type == AT_ETHER)
|
||||
return "bluetooth.dst";
|
||||
else if (conv->dst_address.type == AT_STRINGZ)
|
||||
return "bluetooth.dst_str";
|
||||
}
|
||||
|
||||
if (filter == CONV_FT_ANY_ADDRESS)
|
||||
return "bluetooth.addr";
|
||||
if (filter == CONV_FT_ANY_ADDRESS) {
|
||||
if (conv->src_address.type == AT_ETHER && conv->dst_address.type == AT_ETHER)
|
||||
return "bluetooth.addr";
|
||||
else if (conv->src_address.type == AT_STRINGZ && conv->dst_address.type == AT_STRINGZ)
|
||||
return "bluetooth.addr_str";
|
||||
}
|
||||
|
||||
return CONV_FILTER_INVALID;
|
||||
}
|
||||
|
@ -1563,10 +1575,14 @@ static const char* bluetooth_conv_get_filter_type(conv_item_t* conv _U_, conv_fi
|
|||
static ct_dissector_info_t bluetooth_ct_dissector_info = {&bluetooth_conv_get_filter_type};
|
||||
|
||||
|
||||
static const char* bluetooth_get_filter_type(hostlist_talker_t* host _U_, conv_filter_type_e filter)
|
||||
static const char* bluetooth_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter)
|
||||
{
|
||||
if (filter == CONV_FT_ANY_ADDRESS)
|
||||
return "bluetooth.addr";
|
||||
if (filter == CONV_FT_ANY_ADDRESS) {
|
||||
if (host->myaddress.type == AT_ETHER)
|
||||
return "bluetooth.addr";
|
||||
else if (host->myaddress.type == AT_STRINGZ)
|
||||
return "bluetooth.addr_str";
|
||||
}
|
||||
|
||||
return CONV_FILTER_INVALID;
|
||||
}
|
||||
|
@ -1796,10 +1812,10 @@ dissect_bluetooth_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
dst = (address *) p_get_proto_data(wmem_file_scope(), pinfo, proto_bluetooth, BLUETOOTH_DATA_DST);
|
||||
|
||||
if (src && src->type == AT_STRINGZ) {
|
||||
sub_item = proto_tree_add_string(main_tree, hf_bluetooth_str_addr, tvb, 0, 0, (const char *) src->data);
|
||||
sub_item = proto_tree_add_string(main_tree, hf_bluetooth_addr_str, tvb, 0, 0, (const char *) src->data);
|
||||
PROTO_ITEM_SET_HIDDEN(sub_item);
|
||||
|
||||
sub_item = proto_tree_add_string(main_tree, hf_bluetooth_str_src, tvb, 0, 0, (const char *) src->data);
|
||||
sub_item = proto_tree_add_string(main_tree, hf_bluetooth_src_str, tvb, 0, 0, (const char *) src->data);
|
||||
PROTO_ITEM_SET_GENERATED(sub_item);
|
||||
} else if (src && src->type == AT_ETHER) {
|
||||
sub_item = proto_tree_add_ether(main_tree, hf_bluetooth_addr, tvb, 0, 0, (const guint8 *) src->data);
|
||||
|
@ -1810,10 +1826,10 @@ dissect_bluetooth_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
}
|
||||
|
||||
if (dst && dst->type == AT_STRINGZ) {
|
||||
sub_item = proto_tree_add_string(main_tree, hf_bluetooth_str_addr, tvb, 0, 0, (const char *) dst->data);
|
||||
sub_item = proto_tree_add_string(main_tree, hf_bluetooth_addr_str, tvb, 0, 0, (const char *) dst->data);
|
||||
PROTO_ITEM_SET_HIDDEN(sub_item);
|
||||
|
||||
sub_item = proto_tree_add_string(main_tree, hf_bluetooth_str_dst, tvb, 0, 0, (const char *) dst->data);
|
||||
sub_item = proto_tree_add_string(main_tree, hf_bluetooth_dst_str, tvb, 0, 0, (const char *) dst->data);
|
||||
PROTO_ITEM_SET_GENERATED(sub_item);
|
||||
} else if (dst && dst->type == AT_ETHER) {
|
||||
sub_item = proto_tree_add_ether(main_tree, hf_bluetooth_addr, tvb, 0, 0, (const guint8 *) dst->data);
|
||||
|
@ -1972,18 +1988,18 @@ proto_register_bluetooth(void)
|
|||
FT_ETHER, BASE_NONE, NULL, 0x0,
|
||||
NULL, HFILL }
|
||||
},
|
||||
{ &hf_bluetooth_str_src,
|
||||
{ "Source", "bluetooth.src",
|
||||
{ &hf_bluetooth_src_str,
|
||||
{ "Source", "bluetooth.src_str",
|
||||
FT_STRING, STR_ASCII, NULL, 0x0,
|
||||
NULL, HFILL }
|
||||
},
|
||||
{ &hf_bluetooth_str_dst,
|
||||
{ "Destination", "bluetooth.dst",
|
||||
{ &hf_bluetooth_dst_str,
|
||||
{ "Destination", "bluetooth.dst_str",
|
||||
FT_STRING, STR_ASCII, NULL, 0x0,
|
||||
NULL, HFILL }
|
||||
},
|
||||
{ &hf_bluetooth_str_addr,
|
||||
{ "Source or Destination", "bluetooth.addr",
|
||||
{ &hf_bluetooth_addr_str,
|
||||
{ "Source or Destination", "bluetooth.addr_str",
|
||||
FT_STRING, STR_ASCII, NULL, 0x0,
|
||||
NULL, HFILL }
|
||||
},
|
||||
|
|
|
@ -316,6 +316,7 @@ dissect_btle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
|
|||
tvbuff_t *next_tvb;
|
||||
guint8 *dst_bd_addr;
|
||||
guint8 *src_bd_addr;
|
||||
const guint8 broadcast_addr[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
|
||||
connection_address_t *connection_address = NULL;
|
||||
wmem_tree_t *wmem_tree;
|
||||
wmem_tree_key_t key[5];
|
||||
|
@ -450,7 +451,7 @@ dissect_btle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
|
|||
copy_address_shallow(&pinfo->dl_src, &pinfo->net_src);
|
||||
copy_address_shallow(&pinfo->src, &pinfo->net_src);
|
||||
|
||||
set_address(&pinfo->net_dst, AT_STRINGZ, 10, "broadcast");
|
||||
set_address(&pinfo->net_dst, AT_ETHER, 6, broadcast_addr);
|
||||
copy_address_shallow(&pinfo->dl_dst, &pinfo->net_dst);
|
||||
copy_address_shallow(&pinfo->dst, &pinfo->net_dst);
|
||||
|
||||
|
@ -534,7 +535,7 @@ dissect_btle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
|
|||
copy_address_shallow(&pinfo->dl_src, &pinfo->net_src);
|
||||
copy_address_shallow(&pinfo->src, &pinfo->net_src);
|
||||
|
||||
set_address(&pinfo->net_dst, AT_STRINGZ, 10, "broadcast");
|
||||
set_address(&pinfo->net_dst, AT_ETHER, 6, broadcast_addr);
|
||||
copy_address_shallow(&pinfo->dl_dst, &pinfo->net_dst);
|
||||
copy_address_shallow(&pinfo->dst, &pinfo->net_dst);
|
||||
|
||||
|
|
Loading…
Reference in New Issue