Wireshark-commits: [Wireshark-commits] master 6cc1c8d: Clean up heuristic checks.

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Fri, 14 Aug 2015 03:06:17 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=6cc1c8d98b518b0b4fa86ca4287bacf46a998f61
Submitter: Guy Harris (guy@xxxxxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

6cc1c8d by Guy Harris (guy@xxxxxxxxxxxx):

    Clean up heuristic checks.
    
    Fix heuristic checks to handle sliced packets correctly.  "Correctly"
    means "fail the heuristic", as the heuristic checks every single byte of
    the putative Ixia trailer, as one thing it does is check the checksum,
    which is in the last 2 bytes of the trailer and checks everything before
    it.  So just return 0 if the full trailer isn't part of the captured
    data.
    
    Try to handle being handed a tvbuff that contains an FCS by looking at
    the putative "magic number" locations where it would be if the tvbuff
    didn't include the FCS and, if that doesn't match, where it would be if
    it *did* include the FCS.  If the former doesn't match but the latter
    does, assume that means it does include the FCS, and do all other
    processing under that assumption.
    
    Clean up some comments.
    
    Fix an hf_ variable name to match the field name, and put the tvbuff
    value fields in the order of their types.
    
    Don't fail if the field length is 0 - it's a value length, so it could
    in theory be 0.  Rely on the length checks for individual types to catch
    problems.
    
    Change-Id: Idc834aa6637cfbbafd6499060a007e720378154e
    Reviewed-on: https://code.wireshark.org/review/10024
    Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
    

Actions performed:

    from  3c5fd58   Get rid of trailing whitespace.
    adds  6cc1c8d   Clean up heuristic checks.


Summary of changes:
 epan/dissectors/packet-ixiatrailer.c |   72 ++++++++++++++++++++++------------
 1 file changed, 48 insertions(+), 24 deletions(-)