diff options
author | Peter Wu <peter@lekensteyn.nl> | 2018-07-06 01:08:22 +0200 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2018-07-06 01:35:00 +0200 |
commit | 4ecf9d858b49e76d8a9c29df01ce1bd523ae6704 (patch) | |
tree | ce6ae94e876a873daacd7c4b160def781b8c1c70 /number-to-name.awk | |
parent | 8f85e795ef1f9045b353cf063c12f7dab463f74a (diff) | |
download | wireshark-notes-4ecf9d858b49e76d8a9c29df01ce1bd523ae6704.tar.gz |
crafted-pkt/badsegments.py: test Follow TCP Stream edge cases
For testing various issues such as
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=14944
Code coverage checked with Clang 6.0.0 by building packet-tcp.c with
options from https://clang.llvm.org/docs/SourceBasedCodeCoverage.html
# link.sh is the command to link libwireshark.so with the two profiling options
eval $(jq -r '.[] | select(.file | contains("packet-tcp.c")) | .command' compile_commands.json | sed 's/^[^ ]\+/clang -fprofile-instr-generate -fcoverage-mapping/') && time bash link.sh
llvm-profdata merge -sparse tcp.profraw -o tcp.profdata && llvm-cov show epan/dissectors/CMakeFiles/dissectors.dir/packet-tcp.c.o -instr-profile=tcp.profdata /tmp/wireshark/epan/dissectors/packet-tcp.c -name-regex='check_follow_fragments|follow_tcp_tap_listener'
Tested against https://code.wireshark.org/review/#/c/28614/4 with log:
1c6dc6d31f (master) Some fixes.
777dac163a Follow Stream: ensure linear performance with many packets
b853858e84 tcp: remove repetitive "follow_record->is_server"
98c33f532e tcp: fix Follow TCP Stream with missing (but ACKed) segments
8f4abb0346 tcp: fix Follow TCP Stream for overlapping data
9219c4b1b6 tcp: ignore zero-length payloads for Follow TCP Stream
9499a15a4a Qt: fix wrong Follow Stream text position after changing mode
All cases are covered, except for one:
1122| 1| data_offset = follow_info->seq[is_server] - sequence;
1123| 1| if (data_length <= data_offset) {
1124| 0| data_length = 0;
1125| 1| } else {
To reach that situation, the IP header probably needs to be modified, or
the pcap snaplen/caplen fields. Too much work for now and a visual
inspection shows that the case does not hurt, so just go for it.
Diffstat (limited to 'number-to-name.awk')
0 files changed, 0 insertions, 0 deletions