diff --git a/src/parser.rs b/src/parser.rs index e7ff2d1..eacfbb0 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -71,7 +71,7 @@ pub fn parse (parse_file: &str, filter_str: &str) -> Vec { me.ipv6_header = Some(packet_handler::ipv6_handler( packet.data )).unwrap(); if TCP == me.ipv6_header.unwrap().next_header as usize{ me.tcp_header = Some(packet_handler::tcp_handler( 10, packet.data )).unwrap(); - me.data = packet_handler::payload_handler( 10, 0, packet.data); + me.data = packet_handler::payload_handler( 10, me.tcp_header.unwrap().data_offset, packet.data); } } @@ -115,7 +115,7 @@ pub fn parse_device (parse_device: &str, filter_str: &str, insert_max: &usize) - me.ipv6_header = Some(packet_handler::ipv6_handler( packet.data)).unwrap(); if TCP == me.ipv6_header.unwrap().next_header as usize { me.tcp_header = Some(packet_handler::tcp_handler( 10, packet.data )).unwrap(); - me.data = packet_handler::payload_handler( 10, 0, packet.data); + me.data = packet_handler::payload_handler( 10, me.tcp_header.unwrap().data_offset, packet.data); } }