Open guyharris opened 5 years ago
OK, it appears that version 1.2 did NOT make any incompatible changes to the file format (note: a new block type is NOT an incompatible change, as code unfamiliar with that block type can just ignore it and process whatever stuff it can understand in the file), so:
This means that any future releases of libpcap and Wireshark 3.4.x or latter will handle 1.2 files the same way 1.0 files are handled.
All code that writes 1.2 SHBs should be fixed to conform to the current pcapng spec and write 1.0 SHBs, so that even older libpcaps, older Wiresharks, and any other code not update to handle version 1.2 will be able to read those files without the code being updated.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@geraldcombs: libpcap 1.10 and later will treat 1.2 as 1.0 rather than returning an error and, as noted, Wireshark 3.4 and later do so as well. It may be that those versions are common enough now that continuing to write 1.2 SHBs won't be too big a problem, although commonly-used "enterprise" OS versions might still have older versions of either libpcap or Wireshark, and people might have older desktop Linux distributions and older versions of other OSes, and those might have 1.10 or earlier, so it might still be an issue. (macOS Monterey still has 1.9, although Ventura has 1.10.)
Currently,
sysdig/userspace/libscap/scap_savefile.h
has:If "the file format supported by this library" is pcapng, that is an error, because 1) the minor version of pcapng is determined by the pcapng project, not the sysdig project and 2) the whole point of pcapng's design was to allow as many additions as possible to be made to the file without changing even the minor version number.
To quote the pcapng spec, section 4.1 "Section Header Block":
The current minor version for pcapng is 0, not 2.
Is the format of the blocks you're using is such that most changes to the event table mean that blocks written after the change cannot be read by code written before the change, and it's impossible to avoid this problem? If so, then either:
if you wish to continue to use pcapng as your file format, do not change the major or minor version number in violation of the pcapng specification and, instead, add version numbers to your blocks, so that if the program reading pcapng file has code to read your blocks, that code can deal, as best it can, with different versions of those blocks;
otherwise, if you want your files to be read by programs other than your own programs, choose a different byte-order magic number, so that your file format is different form pcapng.
In either case, you must then take some level of responsibility for code to read your blocks in pcapng files, or your file formats in their entirety. At minimum, this means fully documenting the block and file formats, and notifying the developers of code to read those blocks and files of changes so that they can update their code. It could also involve developing and maintaining that code yourself.
See also issue #1060, over a year old, requesting that the pcapng blocks you've added be documented.