SCTP retransmission detection broken for the first data chunk of each association with relative TSN
Summary
If the relative TSN option add in !3202 (merged) on (which it is by default), then if retransmission occurs with the first data chunk of an association, the first chunk is wrongly reported as a retransmission of the second time it appears.
Steps to reproduce
Open a SCTP file with retransmission, as the crafted packet below. Ensure that Relative TSNs is checked
What is the current bug behavior?
The data chunk with relative TSN in packet 5 is labeled as a retransmission of the same chunk in packet 6, even as the data chunk with TSN 1 in packet 6 is labeled as a retransmission of the one in packet 5. In tshark one-pass mode, neither the first chunk in 5 or 6 is shown as a retransmission.
What is the expected correct behavior?
Packet 5 is the original packet, packet 6 (and 7) are retransmissions.
Sample capture file
Relevant logs and/or screenshots
Build information
3.7.0 (v3.7.0rc0-1203-ge0a11d06077d)
Compiled (64-bit) using GCC 11.2.1 20211203 (Red Hat 11.2.1-7), with Qt 5.15.2,
with libpcap, with POSIX capabilities (Linux), with libnl 3, with GLib 2.70.2,
with PCRE2, with zlib 1.2.11, with Lua 5.1.5, with GnuTLS 3.7.2 and PKCS #11
support, with Gcrypt 1.9.4-unknown, with MIT Kerberos, with MaxMind DB resolver,
with nghttp2 1.45.1, with brotli, with LZ4, with Zstandard, with Snappy, with
libxml2 2.9.12, with libsmi 0.4.8, with QtMultimedia, without automatic updates,
with SpeexDSP (using system library), with Minizip, release build.
Running on Linux 5.15.4-201.fc35.x86_64, with AMD Ryzen 5 5600X 6-Core Processor
(with SSE4.2), with 15960 MB of physical memory, with GLib 2.70.2, with PCRE2
10.37 2021-05-26, with zlib 1.2.11, with Qt 5.15.2, with libpcap 1.10.1 (with
TPACKET_V3), with c-ares 1.17.2, with GnuTLS 3.7.2, with Gcrypt 1.9.4-unknown,
with nghttp2 1.45.1, with brotli 1.0.9, with LZ4 1.9.3, with Zstandard 1.5.1,
with libsmi 0.4.8, with light display mode, without HiDPI, with
LC_TYPE=en_US.UTF-8, binary plugins supported (21 loaded).
Also occurs in 3.6.0