mirror of
https://github.com/mfontanini/libtins
synced 2026-01-23 02:35:57 +01:00
Ignore IPv6 packets with payload after one with no Next Header (#500)
IPv6 data packets with payload or padded bytes received after one with no Next Header were not being parsed correctly, resulting in NULL PDU. This commit fixes the IPv6 parser to be compliant with RFC 2460 Section 4.7 by adding a check in the IPv6 constructor to ignore the subsequent packets if an IPv6 packet contains no Next Header. Signed-off-by: James Raphael Tiovalen <jamestiotio@gmail.com>
This commit is contained in:
@@ -130,7 +130,7 @@ IPv6::IPv6(const uint8_t* buffer, uint32_t total_sz) {
|
|||||||
uint32_t actual_payload_length = payload_length();
|
uint32_t actual_payload_length = payload_length();
|
||||||
bool is_payload_fragmented = false;
|
bool is_payload_fragmented = false;
|
||||||
while (stream) {
|
while (stream) {
|
||||||
if (is_extension_header(current_header)) {
|
if (is_extension_header(current_header) && current_header != NO_NEXT_HEADER) {
|
||||||
if (current_header == FRAGMENT) {
|
if (current_header == FRAGMENT) {
|
||||||
is_payload_fragmented = true;
|
is_payload_fragmented = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user