Wireshark-commits: [Wireshark-commits] master 45eadc0: What we're testing for is byte-swappedness,
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Mon, 02 Sep 2019 23:47:23 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=45eadc049e5dce4d0181050f55a0d5709ac9c3c8
Submitter: "Guy Harris <guy@xxxxxxxxxxxx>"
Changed: branch: master
Repository: wireshark

Commits:

45eadc0 by Guy Harris (guy@xxxxxxxxxxxx):

    What we're testing for is byte-swappedness, not raw endianness.
    
    On a big-endian machine, if the upper 16 bits of the length are non-zero
    and the lower 16 bits are zero, that means that the length is
    *little*-endian.
    
    What we really care about is whether the file is in the reading host's
    native format, so we can just fetch integral values without swapping, or
    not in that format, in which case we have to byte-swap integral values.
    
    Rename the variable and redo the code to match.
    
    (This may have caused the PacketLogger reader to fail on big-endian
    machines.)
    
    Change-Id: Ie1a82a7d40e2c58c0b8d482d7c95ab60061ca980
    Ping-Bug: 10861
    Reviewed-on: https://code.wireshark.org/review/34434
    Petri-Dish: Guy Harris <guy@xxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
    

Actions performed:

    from  6d15429   If we get a short read on the first packet in the open, don't check any more.
     add  45eadc0   What we're testing for is byte-swappedness, not raw endianness.


Summary of changes:
 wiretap/packetlogger.c | 31 ++++++++++++++-----------------
 1 file changed, 14 insertions(+), 17 deletions(-)