Wireshark-bugs: [Wireshark-bugs] [Bug 5330] Network Instruments' trace files sometimes cannot be

Date: Fri, 22 Oct 2010 11:33:15 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5330

Robert Bullen <robert@xxxxxxxxxxxxxx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #5361|                            |review_for_checkin?
               Flag|                            |
             Status|NEW                         |ASSIGNED
         AssignedTo|wireshark-bugs@xxxxxxxxxxxx |robert@xxxxxxxxxxxxxx
                   |g                           |

--- Comment #2 from Robert Bullen <robert@xxxxxxxxxxxxxx> 2010-10-22 11:33:13 PDT ---
Created an attachment (id=5361)
 --> (https://bugs.wireshark.org/bugzilla/attachment.cgi?id=5361)
A proposed patch to fix bug 5330

The root cause of the bug is that the network_instruments.c file reading code
is not accounting for padding between frames or at the end of the file.
Inter-frame padding is not usually zeroed out, while padding at the end of the
file is. So if the magic number reported in the error message is nonzero, the
inter-frame padding was not properly skipped over. If the magic number is zero,
the padding at the end of the file has been reached, in which case all valid
frames have been correctly read.

This patch fixes both problems by correctly skipping over inter-frame padding
and detecting the zeroed out padding at the end of some files.

It also slightly improves readability by moving byte swapping code for packet
header fields from scattered about to immediately after the packet header is
read from the file. And finally, it attempts to make comments more consistent
in case and punctuation.

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.