aboutsummaryrefslogtreecommitdiffstats
path: root/dumpcap.c
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2021-02-07 19:12:44 -0800
committerGuy Harris <gharris@sonic.net>2021-02-07 19:12:44 -0800
commit152fd1fdab24e33b59c83b91ab2a37a99ad99cc6 (patch)
tree8898b33b63f3334c78f2847975c3b442f2548657 /dumpcap.c
parentb12c82c1020e10af242e86ef9b17d4e68ef3e59f (diff)
dumpcap: improve some secondary error emssages.
For "PacketReceivePacket error: The device has been removed. (1617)", report the error in that fashion, indicate that the interface is no longer attached, *and* suggest that this may be an Npcap bug and that the user should report it as such; give the URL for the Npcap issue list. For "The other host terminated the connection", report the error in that fashion, and suggest that it might be a problem with the host on which the capture is being done. Hopefully this will mean fewer bugs filed as *Wireshark* bugs for those issues. (And, with any new capture API in libpcap, these should all turn into specific PCAP_ERROR_ codes, to make it easier to detect them in callers of libpcap.)
Diffstat (limited to 'dumpcap.c')
-rw-r--r--dumpcap.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/dumpcap.c b/dumpcap.c
index 43ce870d1e..a952952c3e 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -4174,6 +4174,16 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
report_capture_error("The network adapter on which the capture was being done "
"is no longer attached; the capture has stopped.",
"");
+ } else if (strcmp(cap_err_str, "PacketReceivePacket error: The device has been removed. (1617)") == 0) {
+ report_capture_error(cap_err_str,
+ "The network adapter on which the capture was being done "
+ "is no longer attached; the capture has stopped.\n\n"
+ "This may be a bug in Npcap: please report it "
+ "as an issue at https://github.com/nmap/npcap/issues");
+ } else if (strcmp(cap_err_str, "The other host terminated the connection") == 0) {
+ report_capture_error(cap_err_str,
+ "This may be a problem with the remote host "
+ "on which you are capturing packets.");
} else {
g_snprintf(errmsg, sizeof(errmsg), "Error while capturing packets: %s",
cap_err_str);