Wireshark-commits: [Wireshark-commits] master 1ac358c: Don't close the pcap_t in get_data_link_type

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

Commits:

1ac358c 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>
    

Actions performed:

    from  25015a0   ftypes: create a set_value union
    adds  1ac358c   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(-)