1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-22 18:25: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:
James R T
2023-04-21 12:22:01 +08:00
committed by GitHub
parent fa87e1b6f6
commit df509e7e36

View File

@@ -130,7 +130,7 @@ IPv6::IPv6(const uint8_t* buffer, uint32_t total_sz) {
uint32_t actual_payload_length = payload_length();
bool is_payload_fragmented = false;
while (stream) {
if (is_extension_header(current_header)) {
if (is_extension_header(current_header) && current_header != NO_NEXT_HEADER) {
if (current_header == FRAGMENT) {
is_payload_fragmented = true;
}