Wireshark-commits: [Wireshark-commits] master-2.4 2713dcb: Catch attempts to write multiple encapsu
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=2713dcbd21bcefdcc56a28abddc745eaa1c3c931
Submitter: "Guy Harris <guy@xxxxxxxxxxxx>"
Changed: branch: master-2.4
Repository: wireshark
Commits:
2713dcb by Guy Harris (guy@xxxxxxxxxxxx):
Catch attempts to write multiple encapsulation types if unsupported.
If, in the process of opening the input file, we determine that it has
packets of more than one link-layer type, we can catch attempts to write
that file to a file of a format that doesn't support more than one
link-layer type at the time we try to open the output file.
If, however, we don't discover that the file has more than one
link-layer type until we've already created the output file - for
example, if we have a pcapng file with a new IDB, with a different
link-layer type from previous IDBs, after packet blocks for the earlier
interfces - we can't catch that until we try to write the packet.
Currently, that causes the packet's data to be written out as is, so the
output file claims it's of the file's link-layer type, causing programs
reading the file to misdissect the packet.
Report WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED on the write attempt
instead, and have a nicer error message for
WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED on a write.
Change-Id: Ic41f2e4367cfe5667eb30c88cc6d3bfe422462f6
Reviewed-on: https://code.wireshark.org/review/30617
Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
(cherry picked from commit 3aec5e1a2882a04aae33207750e9053d5f73174b)
Reviewed-on: https://code.wireshark.org/review/30619
Actions performed:
from 82c5614 tshark: Print the packets' comments in the expert info
add 2713dcb Catch attempts to write multiple encapsulation types if unsupported.
Summary of changes:
ui/alert_box.c | 11 +++++++++++
ui/failure_message.c | 11 +++++++++++
wiretap/5views.c | 9 +++++++++
wiretap/btsnoop.c | 19 +++++++++++++++++++
wiretap/k12.c | 9 +++++++++
wiretap/lanalyzer.c | 9 +++++++++
wiretap/libpcap.c | 9 +++++++++
wiretap/logcat.c | 9 +++++++++
wiretap/logcat_text.c | 9 +++++++++
wiretap/network_instruments.c | 9 +++++++++
wiretap/netxray.c | 18 ++++++++++++++++++
wiretap/ngsniffer.c | 9 +++++++++
wiretap/snoop.c | 9 +++++++++
wiretap/visual.c | 9 +++++++++
14 files changed, 149 insertions(+)