summaryrefslogtreecommitdiff
path: root/ui/tap_export_pdu.c
diff options
context:
space:
mode:
authorHadriel Kaplan <hadrielk@yahoo.com>2014-03-27 17:24:20 -0400
committerAnders Broman <a.broman58@gmail.com>2014-03-27 21:39:57 +0000
commitca9c160933919a85cd22dfd1784dcc04675fb72a (patch)
tree05817d85566dd325f3cbf07b5218d37782065e55 /ui/tap_export_pdu.c
parent9a977fc8d03238f083760205be0d980dccaf3ee7 (diff)
downloadwireshark-ca9c160933919a85cd22dfd1784dcc04675fb72a.tar.gz
Fix bug9931 'Encapsulated ethernet packets sometimes show invalid FCS'
This fixes part-1 of bug9931: the uninitialized use of a wtap_pkthdr struct. The second part of the bug deals with dissectors calling the Ethernet dissector for ecnapsulated Ethernet packets but using the wrong dissector handle to do so. That's unrelated to the issue this commit addresses, so I'm splitting them up. Change-Id: I87be7b736f82dd74d8c261062f88143372b5344c Reviewed-on: https://code.wireshark.org/review/848 Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui/tap_export_pdu.c')
-rw-r--r--ui/tap_export_pdu.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/ui/tap_export_pdu.c b/ui/tap_export_pdu.c
index 2191c40066..ec8c78130f 100644
--- a/ui/tap_export_pdu.c
+++ b/ui/tap_export_pdu.c
@@ -48,6 +48,7 @@ export_pdu_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, co
int buffer_len;
guint8 *packet_buf;
+ memset(&pkthdr, 0, sizeof(struct wtap_pkthdr));
buffer_len = exp_pdu_data->tvb_captured_length + exp_pdu_data->tlv_buffer_len;
packet_buf = (guint8 *)g_malloc(buffer_len);
@@ -64,13 +65,11 @@ export_pdu_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, co
pkthdr.len = exp_pdu_data->tvb_reported_length + exp_pdu_data->tlv_buffer_len;
pkthdr.pkt_encap = exp_pdu_tap_data->pkt_encap;
- pkthdr.interface_id = 0;
- pkthdr.presence_flags = 0;
pkthdr.opt_comment = g_strdup(pinfo->pkt_comment);
- pkthdr.drop_count = 0;
- pkthdr.pack_flags = 0;
pkthdr.presence_flags = WTAP_HAS_CAP_LEN|WTAP_HAS_INTERFACE_ID|WTAP_HAS_TS|WTAP_HAS_PACK_FLAGS;
+ /* XXX: should the pkthdr.pseudo_header be set to the pinfo's pseudo-header? */
+
wtap_dump(exp_pdu_tap_data->wdh, &pkthdr, packet_buf, &err);
g_free(packet_buf);