Do not set buffer size for remote interfaces or when using default value.
authorstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 3 Nov 2008 21:38:53 +0000 (21:38 +0000)
committerstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 3 Nov 2008 21:38:53 +0000 (21:38 +0000)
Do not get link-layer for remote interfaces.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@26683 f5534014-38df-0310-8fa8-9805f1628bb7

capture_sync.c
dumpcap.c
gtk/capture_dlg.c

index ba819677c1e89a1d7ea6665b416095d30eab8ae8..37d3756bcff6d7fd6cce3bbfdcc1dddb7fa82812 100644 (file)
@@ -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
index 3cfeeab9947d7121f16b4cde1c0c8011155470d6..1915c998b42f75921a05cbd2e2fd5cb952b51424 100644 (file)
--- 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"
index 52bfaa8be87810dffbffe33fa511d6bd0c52a337..924fdf2637fb5df7d0c2414d3bafc1cdf6daf050 100644 (file)
@@ -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