Wireshark dissector bug fix and PcapNG writer implementation #138
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change 1 (commit 73d8b): Bug fix
I fixed a small bug in the Wireshark dissector plugin.
Due to the gsmtapv3 specification requiring a
start of datatag instead of padding tohdr_len, the following case is not handled properly.If the packet content after the gsmtapv3 header is very short (e.g. an RRC Connection Reconfiguration Complete is only 2 bytes long)
gsmtapv3_parse_metadata(t, tvbuffer(8, 4 * hdr_len - 8), 4 * hdr_len - 8)tries to access the nothing byte from the table below and causes an index out of bounds error.The introduced check
math.min(tvbuffer:len() - 8, 4 * hdr_len - 8)handles this situation.Change 2 (commits bb402 ... ): Feature
I implemented a very simple PcapNG writer.
Basically, it works exactly the same as the existing
pcapwriter.pyand, thus, can be used as a drop-in replacement for the existing pcapwriter, since it also implements the AbstractWriter interface.However, compared to pcap, the pcapng format has many new features (a nice overview). I was especially interested in the ability to add comments to packets via options fields. Therefore, this feature is also implemented. In addition, the code can easily be extended with other options generators.
Limitations of the current implementation: