* This fix was proposed by @robertsong2019 Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
@@ -3177,7 +3177,7 @@ static pcap_t * openPcapFileOrDevice(u_int16_t thread_id, const u_char * pcap_fi
|
|||||||
char filename[256] = { 0 };
|
char filename[256] = { 0 };
|
||||||
|
|
||||||
if(strstr((char*)pcap_file, (char*)".pcap"))
|
if(strstr((char*)pcap_file, (char*)".pcap"))
|
||||||
printf("ERROR: could not open pcap file %s: %s\n", pcap_file, pcap_error_buffer);
|
printf("ERROR: could not open pcap file: %s\n", pcap_error_buffer);
|
||||||
|
|
||||||
/* Trying to open as a playlist as last attempt */
|
/* Trying to open as a playlist as last attempt */
|
||||||
else if((getNextPcapFileFromPlaylist(thread_id, filename, sizeof(filename)) != 0)
|
else if((getNextPcapFileFromPlaylist(thread_id, filename, sizeof(filename)) != 0)
|
||||||
@@ -3359,7 +3359,8 @@ static void runPcapLoop(u_int16_t thread_id) {
|
|||||||
printf("Unsupported datalink %d. Skip pcap\n", datalink_type);
|
printf("Unsupported datalink %d. Skip pcap\n", datalink_type);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(pcap_loop(ndpi_thread_info[thread_id].workflow->pcap_handle, -1, &ndpi_process_packet, (u_char*)&thread_id) < 0)
|
int ret = pcap_loop(ndpi_thread_info[thread_id].workflow->pcap_handle, -1, &ndpi_process_packet, (u_char*)&thread_id);
|
||||||
|
if (ret == -1)
|
||||||
printf("Error while reading pcap file: '%s'\n", pcap_geterr(ndpi_thread_info[thread_id].workflow->pcap_handle));
|
printf("Error while reading pcap file: '%s'\n", pcap_geterr(ndpi_thread_info[thread_id].workflow->pcap_handle));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user