diff options
author | Vasil Velichkov <vvvelichkov@gmail.com> | 2018-07-21 01:32:55 +0300 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-07-30 12:19:35 +0000 |
commit | 02b2c86c53a519572a564db57ff7decafb5d8d57 (patch) | |
tree | a45f004ba4feca400bbafd7fd2e78b79e2eee578 /ui | |
parent | 5da97a40c5fd83a39c5995b972daec5e39983b88 (diff) |
SCTPGraphArwndDialog: Detect max arwnd value when startArwnd is not set
When the capture does not contains SCTP INIT and INAT_ACK packets the
startArwnd value is 0 (not set) and as a result the Y axis range is
(0,0) and the dots are not visible
Change-Id: Iafb1981e62f28fe09b106138836c866d0dbebb27
Reviewed-on: https://code.wireshark.org/review/28861
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/qt/sctp_graph_arwnd_dialog.cpp | 5 | ||||
-rw-r--r-- | ui/qt/sctp_graph_arwnd_dialog.h | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/ui/qt/sctp_graph_arwnd_dialog.cpp b/ui/qt/sctp_graph_arwnd_dialog.cpp index 1347a543fc..18a6d35b2f 100644 --- a/ui/qt/sctp_graph_arwnd_dialog.cpp +++ b/ui/qt/sctp_graph_arwnd_dialog.cpp @@ -72,6 +72,8 @@ void SCTPGraphArwndDialog::drawArwndGraph() listSACK = g_list_last(selected_assoc->sack2); startArwnd = selected_assoc->arwnd1; } + bool detect_max_arwnd = (startArwnd == 0) ? true : false; + while (listSACK) { tsn = (tsn_t*) (listSACK->data); tlist = g_list_first(tsn->tsns); @@ -84,6 +86,9 @@ void SCTPGraphArwndDialog::drawArwndGraph() nr_sack_header =(struct nr_sack_chunk_header *)tlist->data; arwnd = g_ntohl(nr_sack_header->a_rwnd); } + if (detect_max_arwnd && startArwnd < arwnd) { + startArwnd = arwnd; + } ya.append(arwnd); xa.append(tsn->secs + tsn->usecs/1000000.0); fa.append(tsn->frame_number); diff --git a/ui/qt/sctp_graph_arwnd_dialog.h b/ui/qt/sctp_graph_arwnd_dialog.h index 7edf13e589..c682014f4b 100644 --- a/ui/qt/sctp_graph_arwnd_dialog.h +++ b/ui/qt/sctp_graph_arwnd_dialog.h @@ -49,7 +49,7 @@ private: capture_file *cap_file_; int frame_num; int direction; - int startArwnd; + guint32 startArwnd; QVector<double> xa, ya; QVector<guint32> fa; // QVector<QString> typeStrings; |