From: Cole Dishington Date: Wed, 24 May 2023 00:39:33 +0000 (+1200) Subject: decode-ipv6: Set IPv6 proto incase of ext header parsing error X-Git-Tag: suricata-6.0.13~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96bb6ed0345964c3c760f7470d9a71f663149559;p=thirdparty%2Fsuricata.git decode-ipv6: Set IPv6 proto incase of ext header parsing error Set the IPv6 packet proto before parsing the ext headers, similar to decode-ipv4, incase of an ext header parsing error. Otherwise rule decode-events are not triggered for packets encapsulated in IPv6. Bug: #6086. (cherry picked from commit 531d99f4cf3f7929ef5e972641d2f347c966b979) --- diff --git a/src/decode-ipv6.c b/src/decode-ipv6.c index fe27e471fc..bceb28ea07 100644 --- a/src/decode-ipv6.c +++ b/src/decode-ipv6.c @@ -596,6 +596,7 @@ int DecodeIPV6(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t * CLEAR_IPV6_PACKET(p); return TM_ECODE_FAILED; } + p->proto = IPV6_GET_NH(p); #ifdef DEBUG if (SCLogDebugEnabled()) { /* only convert the addresses if debug is really enabled */