mirror of
https://github.com/mfontanini/libtins
synced 2026-01-30 05:24:26 +01:00
Ported almost everything to BSD. Utils::route_entries and sending link layer PDUs still don't work.
This commit is contained in:
@@ -77,7 +77,7 @@ ICMPv6::ICMPv6(const uint8_t *buffer, uint32_t total_sz)
|
||||
|
||||
void ICMPv6::parse_options(const uint8_t *&buffer, uint32_t &total_sz) {
|
||||
while(total_sz > 0) {
|
||||
if(total_sz < 8 || (buffer[1] * 8) > total_sz)
|
||||
if(total_sz < 8 || (static_cast<uint32_t>(buffer[1]) * 8) > total_sz)
|
||||
throw std::runtime_error("Not enough size for options");
|
||||
// size(option) = option_size - identifier_size - length_identifier_size
|
||||
add_option(icmpv6_option(buffer[0], buffer[1] * 8 - sizeof(uint8_t) * 2, buffer + 2));
|
||||
|
||||
Reference in New Issue
Block a user