diff options
author | Evan Huus <eapache@gmail.com> | 2015-05-12 21:53:32 -0400 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2015-05-16 12:13:45 +0000 |
commit | 85f38f9f75a3c7a41d78ec953ebc23f6439ea426 (patch) | |
tree | 4915efa3cc9f394eede723952fccde39d8eaf35b /epan/tap.c | |
parent | aa6466a7b5015bcbb2bc43b985eb161745337022 (diff) |
tap: Add ability to reject/ignore "error" packets in tap
ICMP (and a few other protocols) can carry "error packets" as payloads in
certain cases. In the same way that we don't (by default) call TCP reassembly
code on TCP packets we know are out-of-order, we also shouldn't call tap code on
frames carried in ICMP error packets.
Bug: 11184
Change-Id: Ie83dbb505c8fdc15c5554705488c16fa0274a06a
Reviewed-on: https://code.wireshark.org/review/8446
Petri-Dish: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'epan/tap.c')
-rw-r--r-- | epan/tap.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/epan/tap.c b/epan/tap.c index ba4a1839e5..0abcbdee71 100644 --- a/epan/tap.c +++ b/epan/tap.c @@ -322,15 +322,19 @@ tap_push_tapped_queue(epan_dissect_t *edt) for(i=0;i<tap_packet_index;i++){ for(tl=(tap_listener_t *)tap_listener_queue;tl;tl=tl->next){ tp=&tap_packet_array[i]; - if(tp->tap_id==tl->tap_id){ - gboolean passed=TRUE; - if(tl->code){ - passed=dfilter_apply_edt(tl->code, edt); + /* Don't tap the packet if its an "error" unless the listener tells us to */ + if ((!tp->pinfo->flags.in_error_pkt) || (tl->flags & TL_REQUIRES_ERROR_PACKETS)) + { + if(tp->tap_id==tl->tap_id){ + gboolean passed=TRUE; + if(tl->code){ + passed=dfilter_apply_edt(tl->code, edt); + } + if(passed && tl->packet){ + tl->needs_redraw|=tl->packet(tl->tapdata, tp->pinfo, edt, tp->tap_specific_data); + } } - if(passed && tl->packet){ - tl->needs_redraw|=tl->packet(tl->tapdata, tp->pinfo, edt, tp->tap_specific_data); - } - } + } } } } |