aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2021-07-20 14:45:52 -0700
committerGuy Harris <gharris@sonic.net>2021-07-20 14:45:52 -0700
commitef542759d0c7003a495436f2194d5821bfc30bd4 (patch)
tree87801d1cb120d04d40af769d61966c2e8111dfb3
parentbb25eca4eb01ef84988314b247b9e7e3e7d12a0f (diff)
text_import: only add the packet flags if we have them.
If we don't know the packet direction, don't bother adding the packet flags option. While we're at it, don't bother casting a guint64 to guint64.
-rw-r--r--ui/text_import.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ui/text_import.c b/ui/text_import.c
index 25dadbe419..7073c6bcc0 100644
--- a/ui/text_import.c
+++ b/ui/text_import.c
@@ -620,10 +620,12 @@ write_current_packet (void)
if (ts_fmt == NULL) { ts_nsec++; } /* fake packet counter */
rec.rec_header.packet_header.caplen = rec.rec_header.packet_header.len = prefix_length + curr_offset + eth_trailer_length;
rec.rec_header.packet_header.pkt_encap = pcap_link_type;
- wtap_block_add_uint32_option(rec.block, OPT_PKT_FLAGS, direction);
rec.presence_flags = WTAP_HAS_CAP_LEN|WTAP_HAS_INTERFACE_ID|WTAP_HAS_TS;
+ if (has_direction) {
+ wtap_block_add_uint32_option(rec.block, OPT_PKT_FLAGS, direction);
+ }
if (has_seqno) {
- wtap_block_add_uint64_option(rec.block, OPT_PKT_PACKETID, (guint64)seqno);
+ wtap_block_add_uint64_option(rec.block, OPT_PKT_PACKETID, seqno);
}
/* XXX - report errors! */