aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-11-28 15:06:13 -0800
committerGuy Harris <guy@alum.mit.edu>2017-11-28 23:06:48 +0000
commitae65dc20eae7e21010b6e33b2cb11724d403acd9 (patch)
treeb1f6dfed0e2875744f3986504fa570f0e357cc37
parent2fdbeb0d785db8d63849f0205313aed4d085f3ec (diff)
Report the actual *error* for CANT_GET_INTERFACE_LIST.
CANT_GET_INTERFACE_LIST does *NOT* mean "No remote interfaces found.", as in "there are no remote interfaces"; a NULL return from get_remote_interface_list() and an err value of 0 means that. CANT_GET_INTERFACE_LIST means "something bad happened and the error string says what it is". Display that error string, so when people report problems: https://github.com/the-tcpdump-group/libpcap/issues/666 they'll give the actual error message, and I'll fix my breakage of the rpcap protocol negotiation: https://github.com/the-tcpdump-group/libpcap/commit/2972769d03dd60d4bce233a12d77a3464f0d9dc4 rather than just wondering what the problem was and asking the reporter of the problem for more information. Report anything other than "there are no remote interfaces" as an error, not a warning. Change-Id: Ia9381953d080e037254f21e47ee7ecc4619b7254 Reviewed-on: https://code.wireshark.org/review/24627 Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r--ui/qt/remote_capture_dialog.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/ui/qt/remote_capture_dialog.cpp b/ui/qt/remote_capture_dialog.cpp
index 258ca42..8a2d4bc 100644
--- a/ui/qt/remote_capture_dialog.cpp
+++ b/ui/qt/remote_capture_dialog.cpp
@@ -127,10 +127,15 @@ void RemoteCaptureDialog::apply_remote()
global_remote_opts.remote_host_opts.auth_username,
global_remote_opts.remote_host_opts.auth_password,
&err, &err_str);
- if (rlist == NULL &&
- (err == CANT_GET_INTERFACE_LIST || err == DONT_HAVE_PCAP)) {
- QMessageBox::warning(this, tr("Error"),
- (err == CANT_GET_INTERFACE_LIST?tr("No remote interfaces found."):tr("PCAP not found")));
+ if (rlist == NULL) {
+ if (err == 0)
+ QMessageBox::warning(this, tr("Error"), tr("No remote interfaces found."));
+ else if (err == CANT_GET_INTERFACE_LIST)
+ QMessageBox::critical(this, tr("Error"), err_str);
+ else if (err == DONT_HAVE_PCAP)
+ QMessageBox::critical(this, tr("Error"), tr("PCAP not found"));
+ else
+ QMessageBox::critical(this, tr("Error"), "Unknown error");
return;
}
if (ui->hostCombo->count() == 0) {