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

Bug: #6222

src/decode-ipv6.c

index 769b967ba13b18d114dc426fbf3ba9ce62238004..4becd063380a0e4980bc97ae9b703e887d850347 100644 (file)
@@ -614,6 +614,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: