forked from osmocom/wireshark
From Klaus Heckelmann via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7221: Avoid wireshark crash on platforms where an 8 byte alignment is required by changing the resp_time field in the icmp_transaction_t from a double to an nstime_t.
svn path=/trunk/; revision=42393
This commit is contained in:
parent
8f557d0874
commit
2eeb504807
|
@ -977,7 +977,7 @@ static icmp_transaction_t *transaction_start(packet_info *pinfo, proto_tree *tre
|
|||
icmp_trans->rqst_frame = PINFO_FD_NUM(pinfo);
|
||||
icmp_trans->resp_frame = 0;
|
||||
icmp_trans->rqst_time = pinfo->fd->abs_ts;
|
||||
icmp_trans->resp_time = 0.0;
|
||||
nstime_set_zero(&icmp_trans->resp_time);
|
||||
se_tree_insert32_array(icmp_info->pdus, icmp_key, (void *)icmp_trans);
|
||||
}
|
||||
else /* Already visited this frame */
|
||||
|
@ -1008,6 +1008,7 @@ static icmp_transaction_t *transaction_end(packet_info *pinfo, proto_tree *tree,
|
|||
emem_tree_key_t icmp_key[2];
|
||||
proto_item *it;
|
||||
nstime_t ns;
|
||||
double resp_time;
|
||||
|
||||
conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst,
|
||||
pinfo->ptype, 0, 0, 0);
|
||||
|
@ -1038,9 +1039,10 @@ static icmp_transaction_t *transaction_end(packet_info *pinfo, proto_tree *tree,
|
|||
PROTO_ITEM_SET_GENERATED(it);
|
||||
|
||||
nstime_delta(&ns, &pinfo->fd->abs_ts, &icmp_trans->rqst_time);
|
||||
icmp_trans->resp_time = nstime_to_msec(&ns);
|
||||
icmp_trans->resp_time = ns;
|
||||
resp_time = nstime_to_msec(&ns);
|
||||
it = proto_tree_add_double_format_value(tree, hf_icmp_resptime, NULL,
|
||||
0, 0, icmp_trans->resp_time, "%.3f ms", icmp_trans->resp_time);
|
||||
0, 0, resp_time, "%.3f ms", resp_time);
|
||||
PROTO_ITEM_SET_GENERATED(it);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ typedef struct _icmp_transaction_t {
|
|||
guint32 rqst_frame;
|
||||
guint32 resp_frame;
|
||||
nstime_t rqst_time;
|
||||
double resp_time;
|
||||
nstime_t resp_time;
|
||||
} icmp_transaction_t;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1148,7 +1148,7 @@ static icmp_transaction_t *transaction_start(packet_info *pinfo, proto_tree *tre
|
|||
icmpv6_trans->rqst_frame = PINFO_FD_NUM(pinfo);
|
||||
icmpv6_trans->resp_frame = 0;
|
||||
icmpv6_trans->rqst_time = pinfo->fd->abs_ts;
|
||||
icmpv6_trans->resp_time = 0.0;
|
||||
nstime_set_zero(&icmpv6_trans->resp_time);
|
||||
se_tree_insert32_array(icmpv6_info->pdus, icmpv6_key, (void *)icmpv6_trans);
|
||||
}
|
||||
else /* Already visited this frame */
|
||||
|
@ -1179,6 +1179,7 @@ static icmp_transaction_t *transaction_end(packet_info *pinfo, proto_tree *tree,
|
|||
emem_tree_key_t icmpv6_key[2];
|
||||
proto_item *it;
|
||||
nstime_t ns;
|
||||
double resp_time;
|
||||
|
||||
conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst,
|
||||
pinfo->ptype, 0, 0, 0);
|
||||
|
@ -1212,11 +1213,12 @@ static icmp_transaction_t *transaction_end(packet_info *pinfo, proto_tree *tree,
|
|||
}
|
||||
|
||||
nstime_delta(&ns, &pinfo->fd->abs_ts, &icmpv6_trans->rqst_time);
|
||||
icmpv6_trans->resp_time = nstime_to_msec(&ns);
|
||||
icmpv6_trans->resp_time = ns;
|
||||
if ( tree )
|
||||
{
|
||||
resp_time = nstime_to_msec(&ns);
|
||||
it = proto_tree_add_double_format_value(tree, hf_icmpv6_resptime, NULL,
|
||||
0, 0, icmpv6_trans->resp_time, "%.3f ms", icmpv6_trans->resp_time);
|
||||
0, 0, resp_time, "%.3f ms", resp_time);
|
||||
PROTO_ITEM_SET_GENERATED(it);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -123,27 +123,28 @@ icmpstat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_,
|
|||
{
|
||||
icmpstat_t *icmpstat = tapdata;
|
||||
const icmp_transaction_t *trans = data;
|
||||
double *rt;
|
||||
double resp_time, *rt;
|
||||
|
||||
if (trans == NULL)
|
||||
return 0;
|
||||
|
||||
if (trans->resp_frame) {
|
||||
resp_time = nstime_to_msec(&trans->resp_time);
|
||||
rt = g_malloc(sizeof(double));
|
||||
if (rt == NULL)
|
||||
return 0;
|
||||
*rt = trans->resp_time;
|
||||
*rt = resp_time;
|
||||
icmpstat->rt_list = g_slist_insert_sorted(icmpstat->rt_list, rt, compare_doubles);
|
||||
icmpstat->num_resps++;
|
||||
if (icmpstat->min_msecs > trans->resp_time) {
|
||||
if (icmpstat->min_msecs > resp_time) {
|
||||
icmpstat->min_frame = trans->resp_frame;
|
||||
icmpstat->min_msecs = trans->resp_time;
|
||||
icmpstat->min_msecs = resp_time;
|
||||
}
|
||||
if (icmpstat->max_msecs < trans->resp_time) {
|
||||
if (icmpstat->max_msecs < resp_time) {
|
||||
icmpstat->max_frame = trans->resp_frame;
|
||||
icmpstat->max_msecs = trans->resp_time;
|
||||
icmpstat->max_msecs = resp_time;
|
||||
}
|
||||
icmpstat->tot_msecs += trans->resp_time;
|
||||
icmpstat->tot_msecs += resp_time;
|
||||
} else if (trans->rqst_frame)
|
||||
icmpstat->num_rqsts++;
|
||||
else
|
||||
|
|
|
@ -124,27 +124,28 @@ icmpv6stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_
|
|||
{
|
||||
icmpv6stat_t *icmpv6stat = tapdata;
|
||||
const icmp_transaction_t *trans = data;
|
||||
double *rt;
|
||||
double resp_time, *rt;
|
||||
|
||||
if (trans == NULL)
|
||||
return 0;
|
||||
|
||||
if (trans->resp_frame) {
|
||||
resp_time = nstime_to_msec(&trans->resp_time);
|
||||
rt = g_malloc(sizeof(double));
|
||||
if (rt == NULL)
|
||||
return 0;
|
||||
*rt = trans->resp_time;
|
||||
*rt = resp_time;
|
||||
icmpv6stat->rt_list = g_slist_insert_sorted(icmpv6stat->rt_list, rt, compare_doubles);
|
||||
icmpv6stat->num_resps++;
|
||||
if (icmpv6stat->min_msecs > trans->resp_time) {
|
||||
if (icmpv6stat->min_msecs > resp_time) {
|
||||
icmpv6stat->min_frame = trans->resp_frame;
|
||||
icmpv6stat->min_msecs = trans->resp_time;
|
||||
icmpv6stat->min_msecs = resp_time;
|
||||
}
|
||||
if (icmpv6stat->max_msecs < trans->resp_time) {
|
||||
if (icmpv6stat->max_msecs < resp_time) {
|
||||
icmpv6stat->max_frame = trans->resp_frame;
|
||||
icmpv6stat->max_msecs = trans->resp_time;
|
||||
icmpv6stat->max_msecs = resp_time;
|
||||
}
|
||||
icmpv6stat->tot_msecs += trans->resp_time;
|
||||
icmpv6stat->tot_msecs += resp_time;
|
||||
} else if (trans->rqst_frame)
|
||||
icmpv6stat->num_rqsts++;
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue