aboutsummaryrefslogtreecommitdiffstats
path: root/ui/text_import.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/text_import.c
parent9a977fc8d03238f083760205be0d980dccaf3ee7 (diff)
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/text_import.c')
-rw-r--r--ui/text_import.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/ui/text_import.c b/ui/text_import.c
index c1cfcf53ae..05fcc25b8f 100644
--- a/ui/text_import.c
+++ b/ui/text_import.c
@@ -520,16 +520,13 @@ write_current_packet (void)
struct wtap_pkthdr pkthdr;
int err;
+ memset(&pkthdr, 0, sizeof(struct wtap_pkthdr));
+
pkthdr.ts.secs = (guint32)ts_sec;
pkthdr.ts.nsecs = ts_usec * 1000;
if (ts_fmt == NULL) { ts_usec++; } /* fake packet counter */
pkthdr.caplen = pkthdr.len = prefix_length + curr_offset + eth_trailer_length;
pkthdr.pkt_encap = pcap_link_type;
- pkthdr.interface_id = 0;
- pkthdr.presence_flags = 0;
- pkthdr.opt_comment = NULL;
- pkthdr.drop_count = 0;
- pkthdr.pack_flags = 0;
pkthdr.pack_flags |= direction;
pkthdr.presence_flags = WTAP_HAS_CAP_LEN|WTAP_HAS_INTERFACE_ID|WTAP_HAS_TS|WTAP_HAS_PACK_FLAGS;