aboutsummaryrefslogtreecommitdiffstats
path: root/randpkt_core
diff options
context:
space:
mode:
Diffstat (limited to 'randpkt_core')
-rw-r--r--randpkt_core/randpkt_core.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/randpkt_core/randpkt_core.c b/randpkt_core/randpkt_core.c
index 628b941c23..b156fb9b67 100644
--- a/randpkt_core/randpkt_core.c
+++ b/randpkt_core/randpkt_core.c
@@ -593,6 +593,13 @@ void randpkt_loop(randpkt_example* example, guint64 produce_count)
}
len_this_pkt = example->sample_length + len_random;
+ if (len_this_pkt > WTAP_MAX_PACKET_SIZE_STANDARD) {
+ /*
+ * Wiretap will fail when trying to read packets
+ * bigger than WTAP_MAX_PACKET_SIZE_STANDARD.
+ */
+ len_this_pkt = WTAP_MAX_PACKET_SIZE_STANDARD;
+ }
rec->rec_header.packet_header.caplen = len_this_pkt;
rec->rec_header.packet_header.len = len_this_pkt;