diff options
author | Guy Harris <guy@alum.mit.edu> | 2019-04-06 14:02:49 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2019-04-06 21:04:02 +0000 |
commit | 937ec02581ee3918e6caa6de75340c28593a22d5 (patch) | |
tree | 7b248de19e92997267b3b6292d216423b4e4f4eb /tshark.c | |
parent | f0a2b8303a9fcd18d09e27d79bd21ac19d9da7d0 (diff) |
1514 is a better initial Buffer size than 1500.
Ethernet packets without the CRC are 1514 bytes long, not 1500 bytes
long; using 1514 bytes will avoid a reallocation for a full-sized
Ethernet packet.
Change-Id: Ie8da3f13bf3df07e23e4478b7dcf84f06dec6a9d
Reviewed-on: https://code.wireshark.org/review/32761
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'tshark.c')
-rw-r--r-- | tshark.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -2737,7 +2737,7 @@ capture_input_new_packets(capture_session *cap_session, int to_read) edt = epan_dissect_new(cf->epan, create_proto_tree, print_packet_info && print_details); wtap_rec_init(&rec); - ws_buffer_init(&buf, 1500); + ws_buffer_init(&buf, 1514); while (to_read-- && cf->provider.wth) { wtap_cleareof(cf->provider.wth); @@ -3068,7 +3068,7 @@ process_cap_file_first_pass(capture_file *cf, int max_packet_count, pass_status_t status = PASS_SUCCEEDED; wtap_rec_init(&rec); - ws_buffer_init(&buf, 1500); + ws_buffer_init(&buf, 1514); /* Allocate a frame_data_sequence for all the frames. */ cf->provider.frames = new_frame_data_sequence(); @@ -3242,7 +3242,7 @@ process_cap_file_second_pass(capture_file *cf, wtap_dumper *pdh, pass_status_t status = PASS_SUCCEEDED; wtap_rec_init(&rec); - ws_buffer_init(&buf, 1500); + ws_buffer_init(&buf, 1514); /* Do we have any tap listeners with filters? */ filtering_tap_listeners = have_filtering_tap_listeners(); @@ -3341,7 +3341,7 @@ process_cap_file_single_pass(capture_file *cf, wtap_dumper *pdh, pass_status_t status = PASS_SUCCEEDED; wtap_rec_init(&rec); - ws_buffer_init(&buf, 1500); + ws_buffer_init(&buf, 1514); framenum = 0; |