aboutsummaryrefslogtreecommitdiffstats
path: root/dumpcap.c
diff options
context:
space:
mode:
authorJoão Valverde <j@v6e.pt>2022-02-24 17:07:45 +0000
committerJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2022-02-24 21:15:51 +0000
commit8cd49b2da0d23562fdc4ef80080a88e50279b458 (patch)
treef15bdae612f51128bde6618921b46f98c15d55c4 /dumpcap.c
parentac6cbbcda3bff6d7c02a8252f9d07b3fd80e402f (diff)
dumpcap: Fix a TODO for Npcap test
Diffstat (limited to 'dumpcap.c')
-rw-r--r--dumpcap.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/dumpcap.c b/dumpcap.c
index 5390f6db5e..75d3a56c9f 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -3863,33 +3863,26 @@ capture_loop_dequeue_packet(void) {
static char *
handle_npcap_bug(char *adapter_name _U_, char *cap_err_str _U_)
{
- GString *pcap_info_str;
- GString *windows_info_str;
- char *msg;
-
- pcap_info_str = g_string_new("");
- // TODO: test directly for Npcap here, so we can remove
- // get_runtime_caplibs_version()
- get_runtime_caplibs_version(pcap_info_str);
- if (!g_str_has_prefix(pcap_info_str->str, "Npcap")) {
+ gboolean have_npcap = FALSE;
+
+#ifdef _WIN32
+ have_npcap = caplibs_have_npcap();
+#endif
+
+ if (!have_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 = ws_strdup_printf("If you have not removed that adapter, this "
+
+ return ws_strdup_printf("If you have not removed that adapter, this "
"is probably a known issue in Npcap resulting from "
"the behavior of the Windows networking stack. "
"Work is being done in Npcap to improve the "
"handling of this issue; it does not need to "
"be reported as a Wireshark or Npcap bug.");
- g_string_free(windows_info_str, TRUE);
- g_string_free(pcap_info_str, TRUE);
- return msg;
}
/* Do the low-level work of a capture.