diff options
author | Gerald Combs <gerald@wireshark.org> | 2008-05-12 19:41:32 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2008-05-12 19:41:32 +0000 |
commit | 20186d494784548f6b8189f139138426fba51c1a (patch) | |
tree | b5c65a87718fe010866d1b2419f7eaa40d25c538 /capture_opts.c | |
parent | 27ccd63ce7385d6f85e4bacd98e589871ea5a1b6 (diff) |
If we have pcap_open, call it instead of pcap_open_live, otherwise we might
crash. The changes to trigcap.c haven't been tested, but _should_ work.
svn path=/trunk/; revision=25279
Diffstat (limited to 'capture_opts.c')
-rw-r--r-- | capture_opts.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/capture_opts.c b/capture_opts.c index 738acaeb98..b39d368dea 100644 --- a/capture_opts.c +++ b/capture_opts.c @@ -153,7 +153,7 @@ capture_opts_log(const char *log_domain, GLogLevelFlags log_level, capture_optio g_log(log_domain, log_level, "Filter : %s", capture_opts->cfilter); g_log(log_domain, log_level, "Interface : %s", capture_opts->iface); /* iface_descr may not been filled in and some C Libraries hate a null ptr for %s */ - g_log(log_domain, log_level, "Interface Descr : %s", + g_log(log_domain, log_level, "Interface Descr : %s", capture_opts->iface_descr ? capture_opts->iface_descr : "<null>"); #ifdef HAVE_PCAP_REMOTE g_log(log_domain, log_level, "Capture source : %s", @@ -735,7 +735,11 @@ capture_opts_print_statistics(gboolean machine_readable) for (if_entry = g_list_first(if_list); if_entry != NULL; if_entry = g_list_next(if_entry)) { if_info = if_entry->data; +#ifdef HAVE_PCAP_OPEN + pch = pcap_open(if_info->name, MIN_PACKET_SIZE, 0, 0, NULL, errbuf); +#else pch = pcap_open_live(if_info->name, MIN_PACKET_SIZE, 0, 0, errbuf); +#endif if (pch) { if_stat = g_malloc(sizeof(if_stat_t)); |