From 99c712ff5a2f4d2d52f90d6f3c711ab6c7990a35 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 9 Feb 2021 11:38:51 -0800 Subject: dumpcap: don't mention Npcap if we're not using it. --- dumpcap.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'dumpcap.c') diff --git a/dumpcap.c b/dumpcap.c index 27ee5662e6..24c8a610ab 100644 --- a/dumpcap.c +++ b/dumpcap.c @@ -3842,12 +3842,22 @@ capture_loop_dequeue_packet(void) { static char * please_report_npcap_bug(char *adapter_name, char *cap_err_str) { - GString *windows_info_str = g_string_new(""); - GString *pcap_info_str = g_string_new(""); + GString *pcap_info_str; + GString *windows_info_str; char *msg; - get_os_version_info(windows_info_str); + pcap_info_str = g_string_new(""); get_runtime_caplibs_version(pcap_info_str); + if (!g_str_has_prefix(pcap_info_str->str, "with Npcap")) { + /* + * We're not using Npcap, so don't recomment a user + * file a bug against Npcap. + */ + g_string_free(pcap_info_str, TRUE); + return g_strdup(""); + } + windows_info_str = g_string_new(""); + get_os_version_info(windows_info_str); msg = g_strdup_printf("If you have not removed that adapter, this " "may be a bug in Npcap: please report it " "as an issue at https://github.com/nmap/npcap/issues\n\n" -- cgit v1.2.3