-S doesn't require an interface, either.
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 19 May 2010 02:55:05 +0000 (02:55 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 19 May 2010 02:55:05 +0000 (02:55 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32883 f5534014-38df-0310-8fa8-9805f1628bb7

dumpcap.c

index be18e3a547e20e9eb9737c2a507b938ca410dcfa..81b3795d8877edc1976f8558f961999f18d29e9d 100644 (file)
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -3597,6 +3597,10 @@ main(int argc, char *argv[])
     exit_main(0);
   }
 
+  /*
+   * "-D" requires no interface to be selected; it's supposed to list
+   * all interfaces.
+   */
   if (list_interfaces) {
     /* Get the list of interfaces */
     GList       *if_list;
@@ -3636,11 +3640,17 @@ main(int argc, char *argv[])
   }
 
   /*
-   * "-D" requires no interface to be selected; it's supposed to list
-   * all interfaces.
-   *
-   * If -D wasn't specified, we have to have an interface; if none
-   * was specified, pick a default.
+   * "-S" requires no interface to be selected; it gives statistics
+   * for all interfaces.
+   */
+  if (print_statistics) {
+    status = print_statistics_loop(machine_readable);
+    exit_main(status);
+  }
+
+  /*
+   * "-L", and capturing, act on a particular interface, so we have to
+   * have an interface; if none was specified, pick a default.
    */
   if (capture_opts_trim_iface(&global_capture_opts, NULL) == FALSE) {
     /* cmdarg_err() already called .... */
@@ -3678,11 +3688,6 @@ main(int argc, char *argv[])
     exit_main(0);
   }
 
-  if (print_statistics) {
-    status = print_statistics_loop(machine_readable);
-    exit_main(status);
-  }
-
   /* We're supposed to do a capture.  Process the remaining arguments. */
   capture_opts_trim_snaplen(&global_capture_opts, MIN_PACKET_SIZE);
   capture_opts_trim_ring_num_files(&global_capture_opts);