diff options
author | AndersBroman <anders.broman@ericsson.com> | 2016-12-13 09:52:31 +0100 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2016-12-13 10:30:42 +0000 |
commit | 97b41a494c214161b358cc99fad843a6f061b283 (patch) | |
tree | 18e7f4a228402595c4f7e5974e0109743b67fcad /ui/tap-rtp-common.c | |
parent | f530b58bb5579e2727f76efa4d72d5025ea6bad1 (diff) | |
download | wireshark-97b41a494c214161b358cc99fad843a6f061b283.tar.gz |
[RTP Analysis] calculate BW correctly whem IPv6 is used.
Change-Id: Ia53efa57042d199673a77c59491215c0e99c9e84
Reviewed-on: https://code.wireshark.org/review/19235
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'ui/tap-rtp-common.c')
-rw-r--r-- | ui/tap-rtp-common.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/ui/tap-rtp-common.c b/ui/tap-rtp-common.c index e5ae415d99..375ee07b39 100644 --- a/ui/tap-rtp-common.c +++ b/ui/tap-rtp-common.c @@ -446,10 +446,18 @@ rtp_packet_analyse(tap_rtp_stat_t *statinfo, statinfo->lastnominaltime = 0; statinfo->pt = rtpinfo->info_payload_type; statinfo->reg_pt = rtpinfo->info_payload_type; - statinfo->bw_history[statinfo->bw_index].bytes = rtpinfo->info_data_len + 28; + if (pinfo->net_src.type == AT_IPv6) { + statinfo->bw_history[statinfo->bw_index].bytes = rtpinfo->info_data_len + 48; + } else { + statinfo->bw_history[statinfo->bw_index].bytes = rtpinfo->info_data_len + 28; + } statinfo->bw_history[statinfo->bw_index].time = current_time; statinfo->bw_index++; - statinfo->total_bytes += rtpinfo->info_data_len + 28; + if (pinfo->net_src.type == AT_IPv6) { + statinfo->total_bytes += rtpinfo->info_data_len + 48; + } else { + statinfo->total_bytes += rtpinfo->info_data_len + 28; + } statinfo->bandwidth = (double)(statinfo->total_bytes*8)/1000; /* Not needed ? initialised to zero? */ statinfo->delta = 0; @@ -634,7 +642,11 @@ rtp_packet_analyse(tap_rtp_stat_t *statinfo, } /* Calculate the BW in Kbps adding the IP+UDP header to the RTP -> 20bytes(IP) + 8bytes(UDP) */ - statinfo->bw_history[statinfo->bw_index].bytes = rtpinfo->info_data_len + 28; + if (pinfo->net_src.type == AT_IPv6) { + statinfo->bw_history[statinfo->bw_index].bytes = rtpinfo->info_data_len + 48; + } else { + statinfo->bw_history[statinfo->bw_index].bytes = rtpinfo->info_data_len + 28; + } statinfo->bw_history[statinfo->bw_index].time = current_time; /* Check if there are more than 1sec in the history buffer to calculate BW in bps. If so, remove those for the calculation */ @@ -644,7 +656,11 @@ rtp_packet_analyse(tap_rtp_stat_t *statinfo, if (statinfo->bw_start_index == BUFF_BW) statinfo->bw_start_index=0; }; /* IP hdr + UDP + RTP */ - statinfo->total_bytes += rtpinfo->info_data_len + 28; + if (pinfo->net_src.type == AT_IPv6){ + statinfo->total_bytes += rtpinfo->info_data_len + 48; + }else{ + statinfo->total_bytes += rtpinfo->info_data_len + 28; + } statinfo->bandwidth = (double)(statinfo->total_bytes*8)/1000; statinfo->bw_index++; if (statinfo->bw_index == BUFF_BW) statinfo->bw_index = 0; |