1
0
Fork 0
This commit is contained in:
Alex Kotov 2021-01-02 14:21:32 +05:00
parent 4b42ce2dbe
commit 170a31bae7
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
1 changed files with 2 additions and 0 deletions

View File

@ -11,6 +11,8 @@ pub struct Response {
}
impl Response {
// TODO: parse IP header with length > 5 and additional options.
//
pub fn parse(source: &SockaddrInx, body: &[u8]) -> Option<Self> {
if body.len() < 2 * (20 /* IP header */ + 8 /* ICMP header */) {
return None