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

src/decode-ipv6.c

index 7629a7c4672c1d8c349a270f0cad7c1649152db8..769b967ba13b18d114dc426fbf3ba9ce62238004 100644 (file)
@@ -574,6 +574,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 */