fixed tcp_header.data_offset in ipv6 branch

This commit is contained in:
gurkenhabicht 2020-05-19 20:04:20 +02:00
parent 18de53015b
commit 2f3d08b21d
1 changed files with 2 additions and 2 deletions

View File

@ -71,7 +71,7 @@ pub fn parse (parse_file: &str, filter_str: &str) -> Vec<QryData> {
me.ipv6_header = Some(packet_handler::ipv6_handler( packet.data )).unwrap(); me.ipv6_header = Some(packet_handler::ipv6_handler( packet.data )).unwrap();
if TCP == me.ipv6_header.unwrap().next_header as usize{ if TCP == me.ipv6_header.unwrap().next_header as usize{
me.tcp_header = Some(packet_handler::tcp_handler( 10, packet.data )).unwrap(); 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(); me.ipv6_header = Some(packet_handler::ipv6_handler( packet.data)).unwrap();
if TCP == me.ipv6_header.unwrap().next_header as usize { if TCP == me.ipv6_header.unwrap().next_header as usize {
me.tcp_header = Some(packet_handler::tcp_handler( 10, packet.data )).unwrap(); 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);
} }
} }