decode/ipv6: flag invalid pkt w/ wrong ip ver event

When the decoder finds a packet with wrong IP version for
IPv4|IPv6-in-IPv6 tunnels, it would set an event, but wouldn't flag the
packet invalid. This fixes that.

Bug #7964

(cherry picked from commit ee7f01c83f)
pull/14800/head
Juliana Fajardini 10 months ago committed by Victor Julien
parent c8e2301922
commit 84970da775

@ -1,4 +1,4 @@
/* Copyright (C) 2007-2024 Open Information Security Foundation /* Copyright (C) 2007-2025 Open Information Security Foundation
* *
* You can copy, redistribute or modify this Program under the terms of * You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free * the GNU General Public License version 2 as published by the Free
@ -58,7 +58,7 @@ static void DecodeIPv4inIPv6(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, c
} }
FlowSetupPacket(p); FlowSetupPacket(p);
} else { } else {
ENGINE_SET_EVENT(p, IPV4_IN_IPV6_WRONG_IP_VER); ENGINE_SET_INVALID_EVENT(p, IPV4_IN_IPV6_WRONG_IP_VER);
} }
} }
@ -83,7 +83,7 @@ static int DecodeIP6inIP6(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p,
} }
FlowSetupPacket(p); FlowSetupPacket(p);
} else { } else {
ENGINE_SET_EVENT(p, IPV6_IN_IPV6_WRONG_IP_VER); ENGINE_SET_INVALID_EVENT(p, IPV6_IN_IPV6_WRONG_IP_VER);
} }
return TM_ECODE_OK; return TM_ECODE_OK;
} }

Loading…
Cancel
Save