we call pcap_open or pcap_open_live when WinPcap isn't loaded - just
return NULL. Don't display the "NPF driver isn't running" dialog if
we're capturing from stdin or a file.
Fix a cut-and-paste error in capture_pcap_linktype_list.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@31275
f5534014-38df-0310-8fa8-
9805f1628bb7
pcap_t*
pcap_open_live(const char *a, int b, int c, int d, char *e)
{
- g_assert(has_wpcap);
- return p_pcap_open_live(a, b, c, d, e);
+ if (!has_wpcap) {
+ return NULL;
+ }
+ return p_pcap_open_live(a, b, c, d, e);
}
#ifdef HAVE_PCAP_REMOTE
pcap_t*
pcap_open(const char *a, int b, int c, int d, struct pcap_rmtauth *e, char *f)
{
- g_assert(has_wpcap);
+ if (!has_wpcap) {
+ return NULL;
+ }
return p_pcap_open(a, b, c, d, e, f);
}
gchar **raw_list, **lt_parts;
data_link_info_t *data_link_info;
- g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_MESSAGE, "Capture Interface List ...");
+ g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_MESSAGE, "Capture Linktype List ...");
/* Try to get our interface list */
err = sync_linktype_list_open(ifname, &msg);
if (err != 0) {
- g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_MESSAGE, "Capture Interface List failed!");
+ g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_MESSAGE, "Capture Linktype List failed!");
if (err_str) {
*err_str = msg;
} else {
#ifdef _WIN32
/* Warn the user if npf.sys isn't loaded. */
- if (!npf_sys_is_running() && recent.privs_warn_if_no_npf && get_os_major_version() >= 6) {
+ if (!stdin_capture && !cf_name && !npf_sys_is_running() && recent.privs_warn_if_no_npf && get_os_major_version() >= 6) {
priv_warning_dialog = simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK,
"The NPF driver isn't running. You may have trouble\n"
"capturing or listing interfaces.");