Update to SMB service response time stats.
For short packets, we might not have enough of the payload to decode the transaction info levels and thus that data structure is NULL. check the pointer to this struct first before we try to dereference it. svn path=/trunk/; revision=8558
This commit is contained in:
parent
fb1dff45b5
commit
8b7b1ff28e
|
@ -1,7 +1,7 @@
|
|||
/* smb_stat.c
|
||||
* smb_stat 2003 Ronnie Sahlberg
|
||||
*
|
||||
* $Id: smb_stat.c,v 1.20 2003/09/26 02:09:44 guy Exp $
|
||||
* $Id: smb_stat.c,v 1.21 2003/09/28 00:00:36 sahlberg Exp $
|
||||
*
|
||||
* Ethereal - Network traffic analyzer
|
||||
* By Gerald Combs <gerald@ethereal.com>
|
||||
|
@ -101,11 +101,15 @@ smbstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, void *psi
|
|||
if(si->cmd==0xA0){
|
||||
smb_nt_transact_info_t *sti=(smb_nt_transact_info_t *)si->sip->extra_info;
|
||||
|
||||
add_srt_table_data(&ss->nt_trans_srt_table, sti->subcmd, &si->sip->req_time, pinfo);
|
||||
if(sti){
|
||||
add_srt_table_data(&ss->nt_trans_srt_table, sti->subcmd, &si->sip->req_time, pinfo);
|
||||
}
|
||||
} else if(si->cmd==0x32){
|
||||
smb_transact2_info_t *st2i=(smb_transact2_info_t *)si->sip->extra_info;
|
||||
|
||||
add_srt_table_data(&ss->trans2_srt_table, st2i->subcmd, &si->sip->req_time, pinfo);
|
||||
if(st2i){
|
||||
add_srt_table_data(&ss->trans2_srt_table, st2i->subcmd, &si->sip->req_time, pinfo);
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* tap-smbstat.c
|
||||
* smbstat 2003 Ronnie Sahlberg
|
||||
*
|
||||
* $Id: tap-smbstat.c,v 1.4 2003/04/25 20:54:16 guy Exp $
|
||||
* $Id: tap-smbstat.c,v 1.5 2003/09/28 00:00:36 sahlberg Exp $
|
||||
*
|
||||
* Ethereal - Network traffic analyzer
|
||||
* By Gerald Combs <gerald@ethereal.com>
|
||||
|
@ -56,7 +56,7 @@ smbstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, void *psi
|
|||
smbstat_t *ss=(smbstat_t *)pss;
|
||||
smb_info_t *si=psi;
|
||||
nstime_t delta;
|
||||
timestat_t *sp;
|
||||
timestat_t *sp=NULL;
|
||||
|
||||
/* we are only interested in reply packets */
|
||||
if(si->request){
|
||||
|
@ -71,12 +71,16 @@ smbstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, void *psi
|
|||
smb_nt_transact_info_t *sti=(smb_nt_transact_info_t *)si->sip->extra_info;
|
||||
|
||||
/*nt transaction*/
|
||||
sp=&(ss->nt_trans[sti->subcmd]);
|
||||
if(sti){
|
||||
sp=&(ss->nt_trans[sti->subcmd]);
|
||||
}
|
||||
} else if(si->cmd==0x32){
|
||||
smb_transact2_info_t *st2i=(smb_transact2_info_t *)si->sip->extra_info;
|
||||
|
||||
/*transaction2*/
|
||||
sp=&(ss->trans2[st2i->subcmd]);
|
||||
if(st2i){
|
||||
sp=&(ss->trans2[st2i->subcmd]);
|
||||
}
|
||||
} else {
|
||||
sp=&(ss->proc[si->cmd]);
|
||||
}
|
||||
|
@ -89,7 +93,9 @@ smbstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, void *psi
|
|||
delta.secs--;
|
||||
}
|
||||
|
||||
time_stat_update(sp,&delta, pinfo);
|
||||
if(sp){
|
||||
time_stat_update(sp,&delta, pinfo);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue