diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-06-24 13:04:22 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-06-24 20:05:28 +0000 |
commit | 5a3632ef4066989f3b8a8c07bd60aab6b56b4623 (patch) | |
tree | 4712f8f16b77a83bee74564fc1d416764f63f352 /tshark.c | |
parent | b4d4218a180552739b5442667063fdb11e164e26 (diff) | |
download | wireshark-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.c | 25 |
1 files changed, 11 insertions, 14 deletions
@@ -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. */ |