Wireshark-commits: [Wireshark-commits] master-2.2 adbe2f5: Don't close the pcap_t in get_data_link_

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Tue, 7 Mar 2017 22:11:10 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=adbe2f565b6566e642268c64ee14e66e9a03ce2f
Submitter: Guy Harris (guy@xxxxxxxxxxxx)
Changed: branch: master-2.2
Repository: wireshark

Commits:

adbe2f5 by Guy Harris (guy@xxxxxxxxxxxx):

    Don't close the pcap_t in get_data_link_types().
    
    1) Its caller closes it, and closing a closed pcap_t can cause Bad
    Things to happen.
    
    2) We're trying to get an error string from it after we're closing it,
    which won't work well, either.
    
    While we're at it, don't use pcap_statustostr() if we don't have it (we
    have it iff we have pcap_create()).
    
    Change-Id: Ieded1e3ae78aea4e0970cf582e780c2846fe9dd5
    Reviewed-on: https://code.wireshark.org/review/20443
    Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
    (cherry picked from commit 1ac358c99ddcddc29d4e7c9fee1591e71f4a6a6e)
    Reviewed-on: https://code.wireshark.org/review/20444
    

Actions performed:

    from  dc9e1a5   Fix issue with dissecting multiple DT1 packets in the frame
    adds  adbe2f5   Don't close the pcap_t in get_data_link_types().


Summary of changes:
 caputils/capture-pcap-util.c |   18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)