Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Control Flow  at packet-gtp.c:2725

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

gtp_match_response

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-gtp.c)expand/collapse
Show more  
 2665  static gtp_msg_hash_t *gtp_match_response(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, gint seq_nr, guint msgtype)
 2666  {
 2667      gtp_msg_hash_t gcr, *gcrp = NULL;
 2668      gtp_conv_info_t *gtp_info = (gtp_conv_info_t *)pinfo->private_data;
 2669   
 2670      gcr.seq_nr=seq_nr;
 2671   
 2672      switch (msgtype) {
 2673      case GTP_MSG_ECHO_REQ:
 2674      case GTP_MSG_CREATE_PDP_REQ:
 2675      case GTP_MSG_UPDATE_PDP_REQ:
 2676      case GTP_MSG_DELETE_PDP_REQ:
 2677          gcr.is_request=TRUE;
 2678          gcr.req_frame=pinfo->fd->num;
 2679          gcr.rep_frame=0;
 2680          break;
 2681      case GTP_MSG_ECHO_RESP:
 2682      case GTP_MSG_CREATE_PDP_RESP:
 2683      case GTP_MSG_UPDATE_PDP_RESP:
 2684      case GTP_MSG_DELETE_PDP_RESP:
 2685          gcr.is_request=FALSE;
 2686          gcr.req_frame=0;
 2687          gcr.rep_frame=pinfo->fd->num;
 2688          break;
 2689          default:;
 2690          break;
 2691      }
 2692   
 2693      gcrp = g_hash_table_lookup(gtp_info->matched, &gcr);
 2694   
 2695      if(gcrp){
 2696   
 2697          gcrp->is_request=gcr.is_request;
 2698   
 2699      } else {
 2700   
 2701          /*no match, let's try to make one*/      
 2702          switch (msgtype) {
 2703          case GTP_MSG_ECHO_REQ:
 2704          case GTP_MSG_CREATE_PDP_REQ:
 2705          case GTP_MSG_UPDATE_PDP_REQ:
 2706          case GTP_MSG_DELETE_PDP_REQ:
 2707              gcr.seq_nr=seq_nr;
 2708   
 2709              gcrp=g_hash_table_lookup(gtp_info->unmatched, &gcr);
 2710              if(gcrp){
 2711                  g_hash_table_remove(gtp_info->unmatched, gcrp);
 2712              }
 2713              /* if we cant reuse the old one, grab a new chunk */
 2714              if(!gcrp){
 2715                  gcrp = se_alloc(sizeof(gtp_msg_hash_t));
 2716              }
 2717              gcrp->seq_nr=seq_nr;
 2718              gcrp->req_frame = pinfo->fd->num;
 2719              gcrp->req_time = pinfo->fd->abs_ts;
 2720              gcrp->rep_frame = 0;
 2721              gcrp->msgtype = msgtype;
 2722              gcrp->is_request = TRUE;
 2723              g_hash_table_insert(gtp_info->unmatched, gcrp, gcrp);
 2724              return NULL;
 2725              break;
 2726          case GTP_MSG_ECHO_RESP:
 2727          case GTP_MSG_CREATE_PDP_RESP:
 2728          case GTP_MSG_UPDATE_PDP_RESP:
 2729          case GTP_MSG_DELETE_PDP_RESP:
 2730              gcr.seq_nr=seq_nr;
 2731              gcrp=g_hash_table_lookup(gtp_info->unmatched, &gcr);
 2732   
 2733              if (gcrp) {
 2734                  if(!gcrp->rep_frame){
 2735                      g_hash_table_remove(gtp_info->unmatched, gcrp);
 2736                      gcrp->rep_frame=pinfo->fd->num;
 2737                      gcrp->is_request=FALSE;
 2738                      g_hash_table_insert(gtp_info->matched, gcrp, gcrp);                  
 2739                  }
 2740              }
 2741              break;
 2742          default:;
 2743          break;
 2744          }
 2745      }
 2746       
 2747      /* we have found a match */
 2748      if (gcrp) {
 2749          proto_item *it;
 2750   
 2751   
 2752          if (gcrp->is_request) {
 2753              it = proto_tree_add_uint(tree, hf_gtp_response_in, tvb, 0, 0, gcrp->rep_frame);
 2754              PROTO_ITEM_SET_GENERATED(it);
 2755          } else {
 2756              nstime_t ns;
 2757   
 2758              it = proto_tree_add_uint(tree, hf_gtp_response_to, tvb, 0, 0, gcrp->req_frame);
 2759              PROTO_ITEM_SET_GENERATED(it);
 2760              nstime_delta(&ns, &pinfo->fd->abs_ts, &gcrp->req_time);
 2761              it = proto_tree_add_time(tree, hf_gtp_time, tvb, 0, 0, &ns);
 2762              PROTO_ITEM_SET_GENERATED(it);
 2763          }
 2764      }
 2765      return gcrp;
 2766  }
Show more  




Change Warning 2620.30984 : Unreachable Control Flow

Priority:
State:
Finding:
Owner:
Note: