RANAP: call nsap properly when bindingID is included in transport address
authorMartin Mathieson <martin.r.mathieson@googlemail.com>
Mon, 22 Jun 2015 23:46:57 +0000 (16:46 -0700)
committerMartin Mathieson <martin.r.mathieson@googlemail.com>
Tue, 23 Jun 2015 04:52:08 +0000 (04:52 +0000)
Change-Id: I45fed890cc2f7f5d106bbb7b35038d8db141fa4e
Reviewed-on: https://code.wireshark.org/review/9036
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
asn1/ranap/ranap.cnf
epan/dissectors/packet-ranap.c

index b9740b2e9ec7703e344cf6837b51a11d9768017e..16886b8afb5bd25115b217fd7a3d5f4e307ce1bd 100644 (file)
@@ -322,10 +322,11 @@ MAX_VAL = asn1_param_get_integer(%(ACTX)s,"upperBound")
                /* IPv6 */
                 proto_tree_add_item(subtree, hf_ranap_transportLayerAddress_ipv6, parameter_tvb, 0, tvb_len, ENC_NA);
        }
-       if (tvb_len==20){
-               item = proto_tree_add_item(subtree, hf_ranap_transportLayerAddress_nsap, parameter_tvb, 0, tvb_len, ENC_NA);
+       /* Length will be 25 if optional bearerId is present */
+       if ((tvb_len==20) || (tvb_len==25)) {
+               item = proto_tree_add_item(subtree, hf_ranap_transportLayerAddress_nsap, parameter_tvb, 0, 20, ENC_NA);
                nsap_tree = proto_item_add_subtree(item, ett_ranap_TransportLayerAddress_nsap);
-               dissect_nsap(parameter_tvb, 0, 20, nsap_tree);
+               dissect_nsap(parameter_tvb, 0, tvb_len, nsap_tree);
        }
 
 #.FN_BODY GTP-TEI VAL_PTR = &parameter_tvb
index 308c3f16dce5dc1534abe93ee4f437312473ef40..17d92209371e0c31f891eca4b6d1d668cbce10c6 100644 (file)
@@ -4576,7 +4576,7 @@ dissect_ranap_GlobalRNC_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _
 
 static int
 dissect_ranap_GTP_TEI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 332 "../../asn1/ranap/ranap.cnf"
+#line 333 "../../asn1/ranap/ranap.cnf"
   tvbuff_t *parameter_tvb=NULL;
   int saved_hf;
 
@@ -7435,7 +7435,7 @@ dissect_ranap_Service_Handover(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *ac
 
 static int
 dissect_ranap_Source_ToTarget_TransparentContainer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 358 "../../asn1/ranap/ranap.cnf"
+#line 359 "../../asn1/ranap/ranap.cnf"
 
 dissect_ranap_SourceRNC_ToTargetRNC_TransparentContainer(tvb , offset, actx ,tree , hf_ranap_ranap_SourceRNC_ToTargetRNC_TransparentContainer_PDU );
 
@@ -7512,7 +7512,7 @@ static const per_sequence_t SourceRNC_ToTargetRNC_TransparentContainer_sequence[
 
 static int
 dissect_ranap_SourceRNC_ToTargetRNC_TransparentContainer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 344 "../../asn1/ranap/ranap.cnf"
+#line 345 "../../asn1/ranap/ranap.cnf"
 /* If SourceRNC-ToTargetRNC-TransparentContainer is called trough
    dissect_ranap_SourceRNC_ToTargetRNC_TransparentContainer_PDU
    ProtocolIE_ID may be unset
@@ -7751,7 +7751,7 @@ dissect_ranap_SRVCC_Operation_Possible(tvbuff_t *tvb _U_, int offset _U_, asn1_c
 
 static int
 dissect_ranap_Target_ToSource_TransparentContainer(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 368 "../../asn1/ranap/ranap.cnf"
+#line 369 "../../asn1/ranap/ranap.cnf"
 
 dissect_ranap_TargetRNC_ToSourceRNC_TransparentContainer(tvb , offset, actx ,tree , hf_ranap_ranap_TargetRNC_ToSourceRNC_TransparentContainer_PDU );
 
@@ -7904,10 +7904,11 @@ dissect_ranap_TransportLayerAddress(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_
                /* IPv6 */
                 proto_tree_add_item(subtree, hf_ranap_transportLayerAddress_ipv6, parameter_tvb, 0, tvb_len, ENC_NA);
        }
-       if (tvb_len==20){
-               item = proto_tree_add_item(subtree, hf_ranap_transportLayerAddress_nsap, parameter_tvb, 0, tvb_len, ENC_NA);
+       /* Length will be 25 if optional bearerId is present */
+       if ((tvb_len==20) || (tvb_len==25)) {
+               item = proto_tree_add_item(subtree, hf_ranap_transportLayerAddress_nsap, parameter_tvb, 0, 20, ENC_NA);
                nsap_tree = proto_item_add_subtree(item, ett_ranap_TransportLayerAddress_nsap);
-               dissect_nsap(parameter_tvb, 0, 20, nsap_tree);
+               dissect_nsap(parameter_tvb, 0, tvb_len, nsap_tree);
        }