Hello,
I was testing the module aclfw, however, I found it cannot work correctly when I wanted to filter a specified source port.
I looked up into the code of ip.rs used by aclfw.
let port_as_u8 = self_as_u8.offset(self.length() as isize);, the offset value may be wrong. self.length() is the whole length of ip packet, not the ip header length.
So let dst_port = BigEndian::read_u16(&port_slice[..16]); gets the wrong value.
Also, port_slice[..16] may not be right.
Hello, I was testing the module aclfw, however, I found it cannot work correctly when I wanted to filter a specified source port. I looked up into the code of ip.rs used by aclfw.
let port_as_u8 = self_as_u8.offset(self.length() as isize);
, the offset value may be wrong.self.length()
is the whole length of ip packet, not the ip header length. Solet dst_port = BigEndian::read_u16(&port_slice[..16]);
gets the wrong value. Also,port_slice[..16]
may not be right.Thanks!