1
0
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:
Steven
2017-10-13 05:03:10 +02:00
committed by Matias Fontanini
parent 04e29858ee
commit c439eccdf8

View File

@@ -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 &&
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;
}