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.)
This commit is contained in:
Guy Harris 2021-02-07 19:12:44 -08:00
parent b12c82c102
commit 152fd1fdab
1 changed files with 10 additions and 0 deletions

View File

@ -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);