]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
decode-ipv6: Set L4 proto on ipv6 incase of GRE decode error
authorCole Dishington <Cole.Dishington@alliedtelesis.co.nz>
Mon, 10 Jul 2023 02:02:18 +0000 (14:02 +1200)
committerVictor Julien <vjulien@oisf.net>
Sat, 22 Jul 2023 04:50:10 +0000 (06:50 +0200)
Set the L4 proto before decoding GRE in ipv6 decoding in case there is a
GRE header decoding error.

Bug: #6222
(cherry picked from commit 1b08c561f6f8f5ae3a1f29b68638f9884673fe58)

src/decode-ipv6.c

index bceb28ea07dbbf4a7f884af5360b3007d5eb9c55..f1defbf42a33608ff7421f26bd4f97368d74ab59 100644 (file)
@@ -636,6 +636,7 @@ int DecodeIPV6(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, const uint8_t *
             DecodeIP6inIP6(tv, dtv, p, pkt + IPV6_HEADER_LEN, IPV6_GET_PLEN(p));
             return TM_ECODE_OK;
         case IPPROTO_GRE:
+            IPV6_SET_L4PROTO(p, IPPROTO_GRE);
             DecodeGRE(tv, dtv, p, pkt + IPV6_HEADER_LEN, IPV6_GET_PLEN(p));
             break;
         case IPPROTO_FRAGMENT: