]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
decode/ipv4: add missing ip-in-ip case handling 13370/head
authorJuliana Fajardini <jufajardini@oisf.net>
Wed, 4 Jun 2025 17:56:25 +0000 (14:56 -0300)
committerVictor Julien <victor@inliniac.net>
Wed, 4 Jun 2025 21:14:43 +0000 (23:14 +0200)
A flow with IPv4 IP in IP traffic won't handle this tunneling case
properly.
This leads to potential malicious traffic not triggering alerts, as well
as other inaccuracies in the logs.

Bug #7725

src/decode-ipv4.c

index 0db3e3cae9d3028e161c3db39f5b989f02b79ba5..2420f9c6aced3d98fb6181199ba13282524c0232 100644 (file)
@@ -595,6 +595,16 @@ int DecodeIPV4(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p,
             FlowSetupPacket(p);
             break;
         }
+        case IPPROTO_IPIP: {
+            /* spawn off tunnel packet */
+            Packet *tp = PacketTunnelPktSetup(tv, dtv, p, data, data_len, DECODE_TUNNEL_IPV4);
+            if (tp != NULL) {
+                PKT_SET_SRC(tp, PKT_SRC_DECODER_IPV4);
+                PacketEnqueueNoLock(&tv->decode_pq, tp);
+            }
+            FlowSetupPacket(p);
+            break;
+        }
         case IPPROTO_IP:
             /* check PPP VJ uncompressed packets and decode tcp dummy */
             if (p->flags & PKT_PPP_VJ_UCOMP) {