Fix for bug 4535: The SSL dissector can not correctly resemple SSL records when the...
[obnox/wireshark/wip.git] / tap-megaco-common.c
index f3ba4d46731204fd9bd7ffa4facaadab8db109b3..882ecba0d7443c2c98393f6c5a0f8092bcf00041 100644 (file)
@@ -112,14 +112,20 @@ int
 megacostat_packet(void *pms, packet_info *pinfo, epan_dissect_t *edt _U_, const void *pmi)
 {
        megacostat_t *ms=(megacostat_t *)pms;
-       const gcp_cmd_t *mi=(gcp_cmd_t*)pmi;
+       const gcp_cmd_t *mi=(const gcp_cmd_t*)pmi;
        nstime_t delta;
        int ret = 0;
 
        switch (mi->type) {
 
         GCP_CMD_REQ_CASE
-               if(mi->trx->initial->framenum != mi->msg->framenum){
+               if(!mi->trx->initial) {
+                       /* Track Context is probably disabled, we cannot 
+                        * measure service response time */
+                       return 0;
+               }
+                       
+               else if(mi->trx->initial->framenum != mi->msg->framenum){
                        /* Duplicate is ignored */
                        ms->req_dup_num++;
                }