mirror of
https://github.com/mfontanini/libtins
synced 2026-01-23 02:35:57 +01:00
Implemented matching for ND protocol related ICMPv6 messages (#257)
- ROUTER_SOLICIT -> ROUTER_ADVERTIST - NEIGHBOUR_SOLICIT -> NEIGHBOUR_ADVERTIST Check if code equals zero according to https://tools.ietf.org/html/rfc4861#page-39
This commit is contained in:
@@ -279,6 +279,10 @@ bool ICMPv6::matches_response(const uint8_t* ptr, uint32_t total_sz) const {
|
|||||||
return hdr_ptr->u_echo.identifier == header_.u_echo.identifier &&
|
return hdr_ptr->u_echo.identifier == header_.u_echo.identifier &&
|
||||||
hdr_ptr->u_echo.sequence == header_.u_echo.sequence;
|
hdr_ptr->u_echo.sequence == header_.u_echo.sequence;
|
||||||
}
|
}
|
||||||
|
else if ( (type() == ROUTER_SOLICIT && hdr_ptr->type == ROUTER_ADVERT) ||
|
||||||
|
(type() == NEIGHBOUR_SOLICIT && hdr_ptr->type == NEIGHBOUR_ADVERT) ) {
|
||||||
|
return hdr_ptr->code == 0;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user