diff options
| author | Steven <steven-chien@users.noreply.github.com> | 2017-10-13 05:03:10 +0200 |
|---|---|---|
| committer | Matias Fontanini <matias.fontanini@gmail.com> | 2017-10-12 20:03:10 -0700 |
| commit | c439eccdf8a11d030373a6a0640957f1a3c91358 (patch) | |
| tree | 60f79a6718bf98638ec41dbb1d72882ef49fe284 | |
| parent | 04e29858ee172ad0a20acd4de2a8bf88da49275c (diff) | |
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
| -rw-r--r-- | src/icmpv6.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/icmpv6.cpp b/src/icmpv6.cpp index 9e2e50a..449e01b 100644 --- a/src/icmpv6.cpp +++ b/src/icmpv6.cpp @@ -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; } |
