aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2019-01-24 16:32:28 +0100
committerPeter Wu <peter@lekensteyn.nl>2019-01-25 12:01:32 +0000
commit0b9b531726d5b18ab1ef9d071a312a3c578743e3 (patch)
tree66441994fbed85c748d45c651f1af2b214bc6a3a /test
parent394e39117f075a924511a0803dea99b1b6a5cc0c (diff)
tcp: fix reporting of "Reassembled in" for OoO initial segment
When the initial segment is OoO, it was recognized as retransmitted. Fix this by remembering which frame actually contains the initial segment. Bug: 15420 Change-Id: If63e2ff581775ff9d396a612839f1bfab30f111f Reviewed-on: https://code.wireshark.org/review/31720 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'test')
-rw-r--r--test/captures/http-ooo2.pcapbin0 -> 536 bytes
-rw-r--r--test/suite_dissection.py34
2 files changed, 34 insertions, 0 deletions
diff --git a/test/captures/http-ooo2.pcap b/test/captures/http-ooo2.pcap
new file mode 100644
index 0000000000..8cab45c920
--- /dev/null
+++ b/test/captures/http-ooo2.pcap
Binary files differ
diff --git a/test/suite_dissection.py b/test/suite_dissection.py
index 0da1b17d18..9af19ec2cd 100644
--- a/test/suite_dissection.py
+++ b/test/suite_dissection.py
@@ -87,3 +87,37 @@ class case_dissect_tcp(subprocesstest.SubprocessTestCase):
'-Y', 'dns', '-Tfields', '-edns.qry.name',
))
self.assertEqual(proc.stdout_str.strip(), 'example.com')
+
+ def test_tcp_out_of_order_first_gap(self, cmd_tshark, capture_file):
+ '''
+ Test reporting of "reassembled_in" in the OoO frame that contains the
+ initial segment (Bug 15420). Additionally, test for proper reporting
+ when the initial segment is retransmitted.
+ For PDU H123 (where H is the HTTP Request header and 1, 2 and 3 are part
+ of the body), the order is: (SYN) 2 H H 1 3 H.
+ '''
+ proc = self.assertRun((cmd_tshark,
+ '-r', capture_file('http-ooo2.pcap'),
+ '-otcp.reassemble_out_of_order:TRUE',
+ '-Tfields',
+ '-eframe.number', '-etcp.reassembled_in', '-e_ws.col.Info',
+ '-2',
+ ))
+ lines = proc.stdout_str.replace('\r', '').split('\n')
+ # 2 - start of OoO MSP
+ self.assertIn('2\t6\t[TCP Previous segment not captured]', lines[1])
+ self.assertIn('[TCP segment of a reassembled PDU]', lines[1])
+ # H - first time that the start of the MSP is delivered
+ self.assertIn('3\t6\t[TCP Out-Of-Order]', lines[2])
+ self.assertIn('[TCP segment of a reassembled PDU]', lines[2])
+ # H - first retransmission.
+ self.assertIn('4\t\t', lines[3])
+ self.assertNotIn('[TCP segment of a reassembled PDU]', lines[3])
+ # 1 - continue reassembly
+ self.assertIn('5\t6\t[TCP Out-Of-Order]', lines[4])
+ self.assertIn('[TCP segment of a reassembled PDU]', lines[4])
+ # 3 - finish reassembly
+ self.assertIn('6\t\tPUT /0 HTTP/1.1', lines[5])
+ # H - second retransmission.
+ self.assertIn('7\t\t', lines[6])
+ self.assertNotIn('[TCP segment of a reassembled PDU]', lines[6])