aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-rtcp.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2006-01-03 16:24:56 +0000
committerAnders Broman <anders.broman@ericsson.com>2006-01-03 16:24:56 +0000
commitd74d5995e2b0dca06c8a29a3a6f97b79e03a6d3d (patch)
tree7ec38a09f779fc892af7b1f38c9db02911145f01 /epan/dissectors/packet-rtcp.c
parent2c144a330cb39ff65b762c6a7142750c4c2b9591 (diff)
From Martin Mathieson
I keep finding finding traces that show new problems with this code. This patch fixes 2 problems: - I've seen RTCP frames containing a SR and RR with identical source info and the lsr matching the current MSW/LSW timestamp of the SR. Don't want to do calculation without real roundtrip info - calculating the gap between the 2 frames was still wrong (sigh) svn path=/trunk/; revision=16934
Diffstat (limited to 'epan/dissectors/packet-rtcp.c')
-rw-r--r--epan/dissectors/packet-rtcp.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/epan/dissectors/packet-rtcp.c b/epan/dissectors/packet-rtcp.c
index a27c6e1efa..087e59fd32 100644
--- a/epan/dissectors/packet-rtcp.c
+++ b/epan/dissectors/packet-rtcp.c
@@ -1713,6 +1713,12 @@ static void calculate_roundtrip_delay(tvbuff_t *tvb, packet_info *pinfo,
p_add_proto_data(pinfo->fd, proto_rtcp, p_packet_data);
}
+ /* Don't allow match seemingly calculated from same frame! */
+ if (pinfo->fd->num == p_conv_data->last_received_frame_number)
+ {
+ return;
+ }
+
/* Any previous report must match the lsr given here */
if (p_conv_data->last_received_ts == lsr)
{
@@ -1722,9 +1728,8 @@ static void calculate_roundtrip_delay(tvbuff_t *tvb, packet_info *pinfo,
gint nseconds_between_packets =
pinfo->fd->abs_ts.nsecs - p_conv_data->last_received_timestamp.nsecs;
-
- gint total_gap = ((seconds_between_packets*1000) +
- nseconds_between_packets) / 1000000;
+ gint total_gap = (seconds_between_packets*1000) +
+ (nseconds_between_packets / 1000000);
gint delay = total_gap - (int)(((double)dlsr/(double)65536) * 1000.0);
/* No useful calculation can be done if dlsr not set... */