Commit 8faec2e2 authored by Nawasan Wisitsingkhon's avatar Nawasan Wisitsingkhon

fix: ipv4 flagment

parent ae5b0429
...@@ -45,7 +45,7 @@ impl IP { ...@@ -45,7 +45,7 @@ impl IP {
let fragment = bytes.read_u16::<BigEndian>().unwrap(); let fragment = bytes.read_u16::<BigEndian>().unwrap();
let flags = Flags { let flags = Flags {
dont_flagment: (fragment & 0x8000) > 0, dont_flagment: (fragment & 0x8000) > 0,
more_fragments: (fragment >> 0x4000) > 0, more_fragments: (fragment & 0x4000) > 0,
}; };
let ttl = bytes.read_u8().unwrap(); let ttl = bytes.read_u8().unwrap();
let protocol = bytes.read_u8().unwrap(); let protocol = bytes.read_u8().unwrap();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment