aboutsummaryrefslogtreecommitdiffstats
path: root/tshark.c
diff options
context:
space:
mode:
authorKovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>2009-09-22 15:06:52 +0000
committerKovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>2009-09-22 15:06:52 +0000
commita9a1866acffbdb57f364f7bc814496a507b9bf77 (patch)
tree8ef79a33e16b43e62710ef0df82e3bfc7ad3f1f8 /tshark.c
parent1e8d9b49377ea62d83bd5e6618e7d39462333641 (diff)
Simply some logic inside process_packet()
svn path=/trunk/; revision=30069
Diffstat (limited to 'tshark.c')
-rw-r--r--tshark.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/tshark.c b/tshark.c
index ec8a4d559d..9055f96001 100644
--- a/tshark.c
+++ b/tshark.c
@@ -2343,26 +2343,27 @@ process_packet(capture_file *cf, gint64 offset, const struct wtap_pkthdr *whdr,
/* Count this packet. */
cf->count++;
+ /* If we're not running a display filter and we're not printing any
+ packet information, we don't need to do a dissection. This means
+ that all packets can be marked as 'passed'. */
+ passed = TRUE;
+
/* If we're going to print packet information, or we're going to
run a read filter, or we're going to process taps, set up to
do a dissection and do so. */
if (do_dissection) {
frame_data_init(&fdata, cf->count, whdr, offset, cum_bytes);
- if (print_packet_info) {
+ if (print_packet_info && g_resolv_flags)
/* Grab any resolved addresses */
+ host_name_lookup_process(NULL);
- if (g_resolv_flags) {
- host_name_lookup_process(NULL);
- }
- }
-
- passed = TRUE;
if (cf->rfcode || verbose || filtering_tap_listeners ||
(tap_flags & TL_REQUIRES_PROTO_TREE) || have_custom_cols(&cf->cinfo))
create_proto_tree = TRUE;
else
create_proto_tree = FALSE;
+
/* The protocol tree will be "visible", i.e., printed, only if we're
printing packet details, which is true if we're printing stuff
("print_packet_info" is true) and we're in verbose mode ("verbose"
@@ -2401,13 +2402,6 @@ process_packet(capture_file *cf, gint64 offset, const struct wtap_pkthdr *whdr,
/* Run the read filter if we have one. */
if (cf->rfcode)
passed = dfilter_apply_edt(cf->rfcode, &edt);
- else
- passed = TRUE;
- } else {
- /* We're not running a display filter and we're not printing any
- packet information, so we don't need to do a dissection, and all
- packets are processed. */
- passed = TRUE;
}
if (passed) {