aboutsummaryrefslogtreecommitdiffstats
path: root/extcap/sshdump.c
diff options
context:
space:
mode:
Diffstat (limited to 'extcap/sshdump.c')
-rw-r--r--extcap/sshdump.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/extcap/sshdump.c b/extcap/sshdump.c
index a635834800..7f91ff231a 100644
--- a/extcap/sshdump.c
+++ b/extcap/sshdump.c
@@ -19,6 +19,7 @@
#include <wsutil/strtoi.h>
#include <wsutil/filesystem.h>
#include <wsutil/privileges.h>
+#include <wsutil/please_report_bug.h>
#include <errno.h>
#include <string.h>
@@ -337,7 +338,7 @@ static char* concat_filters(const char* extcap_filter, const char* remote_filter
int main(int argc, char *argv[])
{
- char* init_progfile_dir_error;
+ char* err_msg;
int result;
int option_idx = 0;
ssh_params_t* ssh_params = ssh_params_new();
@@ -352,10 +353,6 @@ int main(int argc, char *argv[])
gboolean use_sudo = FALSE;
gboolean noprom = FALSE;
-#ifdef _WIN32
- WSADATA wsaData;
-#endif /* _WIN32 */
-
/*
* Get credential information for later use.
*/
@@ -365,11 +362,11 @@ int main(int argc, char *argv[])
* Attempt to get the pathname of the directory containing the
* executable file.
*/
- init_progfile_dir_error = init_progfile_dir(argv[0]);
- if (init_progfile_dir_error != NULL) {
+ err_msg = init_progfile_dir(argv[0]);
+ if (err_msg != NULL) {
g_warning("Can't get pathname of directory containing the captype program: %s.",
- init_progfile_dir_error);
- g_free(init_progfile_dir_error);
+ err_msg);
+ g_free(err_msg);
}
help_url = data_file_url("sshdump.html");
@@ -521,13 +518,13 @@ int main(int argc, char *argv[])
goto end;
}
-#ifdef _WIN32
- result = WSAStartup(MAKEWORD(2, 2), &wsaData);
- if (result != 0) {
- g_warning("ERROR: WSAStartup failed with error: %d", result);
+ err_msg = ws_init_sockets();
+ if (err_msg != NULL) {
+ g_warning("ERROR: %s", err_msg);
+ g_free(err_msg);
+ g_warning("%s", please_report_bug());
goto end;
}
-#endif /* _WIN32 */
if (extcap_conf->capture) {
char* filter;