Wireshark-commits: [Wireshark-commits] master-2.0 c8eac6b: Fix handling of the byte order magic num

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Sat, 23 Jan 2016 01:16:32 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=c8eac6b3d8a391948aa17c10da26264eb55d4bb5
Submitter: Guy Harris (guy@xxxxxxxxxxxx)
Changed: branch: master-2.0
Repository: wireshark

Commits:

c8eac6b by Guy Harris (guy@xxxxxxxxxxxx):

    Fix handling of the byte order magic number.
    
    Just treat it as an array of bytes.  When checking for whether it's a
    pcapng file, also determine whether it's big-endian or little-endian.
    Note that reading it in *host* byte order will tell you whether it's in
    your byte order or byte-swapped; you have to know your byte order to
    know whether that means little-endian or big-endian.
    
    Have a #define for the byte-order magic number size, as all byte order
    magic number values must be that size, and use that as the size of the
    magic-number arrays.
    
    Also use a #define for the SHB block type magic number.
    
    Get rid of a now-unused expert info.  (If the magic number isn't
    something we recognize, we don't treat the file as a pcap file, so it
    can never be "unknown".)
    
    Change-Id: Ic74cceac17d1490eb70a28f67cb4dbb512e031ac
    Reviewed-on: https://code.wireshark.org/review/13494
    Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
    (cherry picked from commit e406703c5f8d341153e0b91cc16638c3a556ae49)
    Reviewed-on: https://code.wireshark.org/review/13495
    

Actions performed:

    from  cf4c9e2   Get rid of now-unused expert info.
    adds  c8eac6b   Fix handling of the byte order magic number.


Summary of changes:
 epan/dissectors/file-pcapng.c |   54 ++++++++++++++++++++---------------------
 1 file changed, 26 insertions(+), 28 deletions(-)