summaryrefslogtreecommitdiff
path: root/tshark.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-06-24 13:04:22 -0700
committerGuy Harris <guy@alum.mit.edu>2014-06-24 20:05:28 +0000
commit5a3632ef4066989f3b8a8c07bd60aab6b56b4623 (patch)
tree4712f8f16b77a83bee74564fc1d416764f63f352 /tshark.c
parentb4d4218a180552739b5442667063fdb11e164e26 (diff)
downloadwireshark-5a3632ef4066989f3b8a8c07bd60aab6b56b4623.tar.gz
Load WinPcap before we get the run-time information string.
That way, we can include the WinPcap version in that string. Change-Id: I01fa0defce158e122d1c602fdfbc81916a9e80ef Reviewed-on: https://code.wireshark.org/review/2625 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'tshark.c')
-rw-r--r--tshark.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/tshark.c b/tshark.c
index 7360652961..8b1d522713 100644
--- a/tshark.c
+++ b/tshark.c
@@ -897,18 +897,6 @@ print_current_user(void) {
}
static void
-check_capture_privs(void) {
-#ifdef _WIN32
- load_wpcap();
- /* Warn the user if npf.sys isn't loaded. */
- if (!npf_sys_is_running() && get_windows_major_version() >= 6) {
- fprintf(stderr, "The NPF driver isn't running. You may have trouble "
- "capturing or\nlisting interfaces.\n");
- }
-#endif
-}
-
-static void
show_version(GString *comp_info_str, GString *runtime_info_str)
{
printf("TShark %s\n"
@@ -1005,6 +993,17 @@ main(int argc, char *argv[])
static const char optstring[] = OPTSTRING;
+#ifdef _WIN32
+ /* Load wpcap if possible. Do this before collecting the run-time version information */
+ load_wpcap();
+
+ /* Warn the user if npf.sys isn't loaded. */
+ if (!npf_sys_is_running() && get_windows_major_version() >= 6) {
+ fprintf(stderr, "The NPF driver isn't running. You may have trouble "
+ "capturing or\nlisting interfaces.\n");
+ }
+#endif
+
/* Assemble the compile-time version information string */
comp_info_str = g_string_new("Compiled ");
get_compiled_version_info(comp_info_str, NULL, epan_get_compiled_version_info);
@@ -1284,8 +1283,6 @@ main(int argc, char *argv[])
g_free(dp_path);
}
- check_capture_privs();
-
cap_file_init(&cfile);
/* Print format defaults to this. */