text2pcap: extend snap length
authorJaap Keuter <jaap.keuter@xs4all.nl>
Wed, 5 Dec 2018 15:08:06 +0000 (16:08 +0100)
committerGuy Harris <guy@alum.mit.edu>
Wed, 5 Dec 2018 18:50:17 +0000 (18:50 +0000)
The snaplength as saved in the capture file is set to the original
PCAP file length of 65535. In reality the package size can grow to
256kiB. Make use of the correct constant when writing the PCAP file.

Bug: 15292
Change-Id: Ib7710e4151cdc712f3344c1436252f9b3bfb556c
Signed-off-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Reviewed-on: https://code.wireshark.org/review/30923
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
text2pcap.c

index 8f1745565dcce9b748ddb97f7ea8783d5094013a..62c3d288344bcd3e1c349ff63f67def502d7b49a 100644 (file)
@@ -386,7 +386,6 @@ static char tempbuf[64];
 /*----------------------------------------------------------------------
  * Stuff for writing a PCap file
  */
-#define PCAP_SNAPLEN        0xffff
 
 /* Link-layer type; see http://www.tcpdump.org/linktypes.html for details */
 static guint32 pcap_link_type = 1;   /* Default is LINKTYPE_ETHERNET */
@@ -898,7 +897,7 @@ write_file_header (void)
                                                                "",
                                                                NULL,
                                                                pcap_link_type,
-                                                               PCAP_SNAPLEN,
+                                                               WTAP_MAX_PACKET_SIZE_STANDARD,
                                                                &bytes_written,
                                                                0,
                                                                9,
@@ -906,7 +905,7 @@ write_file_header (void)
         }
     } else {
         success = libpcap_write_file_header(output_file, pcap_link_type,
-                                            PCAP_SNAPLEN, FALSE,
+                                            WTAP_MAX_PACKET_SIZE_STANDARD, FALSE,
                                             &bytes_written, &err);
     }
     if (!success) {