]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
decode-ipv6: Set IPv6 proto incase of ext header parsing error 9023/head
authorCole Dishington <Cole.Dishington@alliedtelesis.co.nz>
Wed, 24 May 2023 00:39:33 +0000 (12:39 +1200)
committerVictor Julien <vjulien@oisf.net>
Tue, 13 Jun 2023 17:28:50 +0000 (19:28 +0200)
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)

src/decode-ipv6.c

index fe27e471fc7bad477a3c9e49a08bd2093ef64732..bceb28ea07dbbf4a7f884af5360b3007d5eb9c55 100644 (file)
@@ -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 */