From 32d411be1d003e70becb211bef09e2b8f23e5717 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Bj=C3=B8rlykke?= Date: Mon, 3 Nov 2008 21:38:53 +0000 Subject: [PATCH] Do not set buffer size for remote interfaces or when using default value. Do not get link-layer for remote interfaces. svn path=/trunk/; revision=26683 --- capture_sync.c | 6 ++++++ dumpcap.c | 3 ++- gtk/capture_dlg.c | 8 ++------ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/capture_sync.c b/capture_sync.c index ba819677c1..37d3756bcf 100644 --- a/capture_sync.c +++ b/capture_sync.c @@ -401,6 +401,12 @@ sync_pipe_start(capture_options *capture_opts) { #ifdef _WIN32 argv = sync_pipe_add_arg(argv, &argc, "-B"); +#ifdef HAVE_PCAP_REMOTE + if (capture_opts->src_type == CAPTURE_IFREMOTE) + /* No buffer size when using remote interfaces */ + g_snprintf(buffer_size, ARGV_NUMBER_LEN, "%d", 1); + else +#endif g_snprintf(buffer_size, ARGV_NUMBER_LEN, "%d",capture_opts->buffer_size); argv = sync_pipe_add_arg(argv, &argc, buffer_size); #endif diff --git a/dumpcap.c b/dumpcap.c index 3cfeeab994..1915c998b4 100644 --- a/dumpcap.c +++ b/dumpcap.c @@ -1228,7 +1228,8 @@ capture_loop_open_input(capture_options *capture_opts, loop_data *ld, /* we've opened "iface" as a network device */ #ifdef _WIN32 /* try to set the capture buffer size */ - if (pcap_setbuff(ld->pcap_h, capture_opts->buffer_size * 1024 * 1024) != 0) { + if (capture_opts->buffer_size > 1 && + pcap_setbuff(ld->pcap_h, capture_opts->buffer_size * 1024 * 1024) != 0) { sync_secondary_msg_str = g_strdup_printf( "The capture buffer size of %luMB seems to be too high for your machine,\n" "the default of 1MB will be used.\n" diff --git a/gtk/capture_dlg.c b/gtk/capture_dlg.c index 52bfaa8be8..924fdf2637 100644 --- a/gtk/capture_dlg.c +++ b/gtk/capture_dlg.c @@ -290,12 +290,8 @@ set_link_type_list(GtkWidget *linktype_om, GtkWidget *entry) */ #ifdef HAVE_PCAP_REMOTE if (global_capture_opts.src_type == CAPTURE_IFREMOTE) - if_list = get_remote_interface_list(global_capture_opts.remote_host, - global_capture_opts.remote_port, - global_capture_opts.auth_type, - global_capture_opts.auth_username, - global_capture_opts.auth_password, - &err, NULL); + /* Not able to get link-layer for remote interfaces */ + if_list = NULL; else if_list = capture_interface_list(&err, NULL); #else