diff options
author | Piotr Tulpan <piotr.tulpan@netscan.pl> | 2017-06-20 19:32:36 +0200 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2017-07-04 17:06:12 +0000 |
commit | bb470c9067a1f44b2665d26d1af38efa722e30a1 (patch) | |
tree | d80b8b1c5ce87c8bf185372cb33ebedf0d38a6ab /epan/dissectors/packet-umts_fp.c | |
parent | 367effa93ca4d5a9e3e4584be103f2a2a7dfa962 (diff) |
NBAP: improve conversation management
Keeps the address of the newly opened channels in the CTCH-SetupRqst message
to match them with the addresses sent in the Respone message to get exatch
match of the conversation.
Change-Id: I445e08480ddd178f65979b9fbc91c6031e206a61
Reviewed-on: https://code.wireshark.org/review/22271
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-umts_fp.c')
-rw-r--r-- | epan/dissectors/packet-umts_fp.c | 65 |
1 files changed, 37 insertions, 28 deletions
diff --git a/epan/dissectors/packet-umts_fp.c b/epan/dissectors/packet-umts_fp.c index cafe80d1f3..5db371cc2b 100644 --- a/epan/dissectors/packet-umts_fp.c +++ b/epan/dissectors/packet-umts_fp.c @@ -5446,7 +5446,7 @@ dissect_fp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat proto_item *ti; gint offset = 0; struct fp_info *p_fp_info; - conversation_t *p_conv; + conversation_t *p_conv = NULL; umts_fp_conversation_info_t *p_conv_data = NULL; /* Append this protocol name rather than replace. */ @@ -5462,40 +5462,49 @@ dissect_fp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat p_fp_info = (struct fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0); /* Check if we have conversation info */ + /* Trying to find exact match - with both RNC's address & port and Node B's address & port */ p_conv = (conversation_t *)find_conversation(pinfo->num, &pinfo->net_dst, &pinfo->net_src, pinfo->ptype, - pinfo->destport, pinfo->srcport, NO_ADDR_B); - - + pinfo->destport, pinfo->srcport, 0); if (p_conv) { p_conv_data = (umts_fp_conversation_info_t *)conversation_get_proto_data(p_conv, proto_fp); - if (p_conv_data) { - /*Figure out the direction of the link*/ - if (addresses_equal(&(pinfo->net_dst), (&p_conv_data->crnc_address))) { - - proto_item *item= proto_tree_add_uint(fp_tree, hf_fp_ul_setup_frame, - tvb, 0, 0, p_conv_data->ul_frame_number); - - PROTO_ITEM_SET_GENERATED(item); - /* CRNC -> Node B */ - pinfo->link_dir=P2P_DIR_UL; - if (p_fp_info == NULL) { - p_fp_info = fp_set_per_packet_inf_from_conv(p_conv, p_conv_data, tvb, pinfo, fp_tree); - } + } + if (!p_conv || !p_conv_data) { + /* Didn't find exact conversation match */ + /* Try to find a partial match with just the source/destination included */ + p_conv = (conversation_t *)find_conversation(pinfo->num, &pinfo->net_dst, &pinfo->net_src, + pinfo->ptype, + pinfo->destport, pinfo->srcport, NO_ADDR2); + if (p_conv) { + p_conv_data = (umts_fp_conversation_info_t *)conversation_get_proto_data(p_conv, proto_fp); + } + } + + if (p_conv_data) { + /*Figure out the direction of the link*/ + if (addresses_equal(&(pinfo->net_dst), (&p_conv_data->crnc_address))) { + + proto_item *item= proto_tree_add_uint(fp_tree, hf_fp_ul_setup_frame, + tvb, 0, 0, p_conv_data->ul_frame_number); + + PROTO_ITEM_SET_GENERATED(item); + /* CRNC -> Node B */ + pinfo->link_dir=P2P_DIR_UL; + if (p_fp_info == NULL) { + p_fp_info = fp_set_per_packet_inf_from_conv(p_conv, p_conv_data, tvb, pinfo, fp_tree); } - else { - /* Maybe the frame number should be stored in the proper location already in nbap?, in ul_frame_number*/ - proto_item *item= proto_tree_add_uint(fp_tree, hf_fp_dl_setup_frame, - tvb, 0, 0, p_conv_data->ul_frame_number); - - PROTO_ITEM_SET_GENERATED(item); - pinfo->link_dir=P2P_DIR_DL; - if (p_fp_info == NULL) { - p_fp_info = fp_set_per_packet_inf_from_conv(p_conv, p_conv_data, tvb, pinfo, fp_tree); - } + } + else { + /* Maybe the frame number should be stored in the proper location already in nbap?, in ul_frame_number*/ + proto_item *item= proto_tree_add_uint(fp_tree, hf_fp_dl_setup_frame, + tvb, 0, 0, p_conv_data->ul_frame_number); + + PROTO_ITEM_SET_GENERATED(item); + pinfo->link_dir=P2P_DIR_DL; + if (p_fp_info == NULL) { + p_fp_info = fp_set_per_packet_inf_from_conv(p_conv, p_conv_data, tvb, pinfo, fp_tree); } } - } if (pinfo->p2p_dir == P2P_DIR_UNKNOWN) { |