# enabled: true
# track-parent-flow: true # disabled by default
+IPv6
+^^^^
+
+By default, for IPv4 over IPv6 tunneling, the parent flow is not set up, as this
+can lead to discrepancies in alerts and flows detected. To enable this setting,
+change::
+
+ decoder:
+ ipv6:
+ ipip-ipv4:
+ track-parent-flow: true
+
+The same is true for IPv6 over IPv6. To enable parent flow setting in this case::
+
+ decoder:
+ ipv6:
+ ipip-ipv6:
+ track-parent-flow: true
+
Advanced Options
----------------
#include "decode-ipv6.h"
#include "decode.h"
#include "defrag.h"
+#include "flow-hash.h"
#include "util-print.h"
#include "util-validate.h"
+static bool g_ipv4_in_ipv6_parent_flow_enabled = false;
+static bool g_ipv6_in_ipv6_parent_flow_enabled = false;
+
+void DecodeIPV4InIPV6Config(void)
+{
+ int enabled = 0;
+
+ if (ConfGetBool("decoder.ipv6.ipip-ipv4.track-parent-flow", &enabled) == 1) {
+ if (enabled) {
+ g_ipv4_in_ipv6_parent_flow_enabled = true;
+ } else {
+ g_ipv4_in_ipv6_parent_flow_enabled = false;
+ }
+ }
+}
+
+void DecodeIPV6InIPV6Config(void)
+{
+ int enabled = 0;
+
+ if (ConfGetBool("decoder.ipv6.ipip-ipv6.track-parent-flow", &enabled) == 1) {
+ if (enabled) {
+ g_ipv6_in_ipv6_parent_flow_enabled = true;
+ } else {
+ g_ipv6_in_ipv6_parent_flow_enabled = false;
+ }
+ }
+}
+
/**
* \brief Function to decode IPv4 in IPv6 packets
*
PKT_SET_SRC(tp, PKT_SRC_DECODER_IPV6);
PacketEnqueueNoLock(&tv->decode_pq,tp);
StatsIncr(tv, dtv->counter_ipv4inipv6);
- return;
+ }
+ if (g_ipv4_in_ipv6_parent_flow_enabled) {
+ FlowSetupPacket(p);
}
} else {
ENGINE_SET_EVENT(p, IPV4_IN_IPV6_WRONG_IP_VER);
PacketEnqueueNoLock(&tv->decode_pq,tp);
StatsIncr(tv, dtv->counter_ipv6inipv6);
}
+ if (g_ipv6_in_ipv6_parent_flow_enabled) {
+ FlowSetupPacket(p);
+ }
} else {
ENGINE_SET_EVENT(p, IPV6_IN_IPV6_WRONG_IP_VER);
}
#define IPV6_EXTHDR_SET_RH(p) (p)->ip6eh.rh_set = true
#define IPV6_EXTHDR_ISSET_RH(p) (p)->ip6eh.rh_set
+void DecodeIPV4InIPV6Config(void);
+void DecodeIPV6InIPV6Config(void);
void DecodeIPV6RegisterTests(void);
#endif /* __DECODE_IPV6_H__ */
# ipip:
# enabled: true
# track-parent-flow: true # disabled by default
+ # Set parent flow for packets seen in IP-in-IP tunneling for ipv4 or ipv6
+ # over ipv6.
+ # Disabled by default, as these will impact number of alerts seen, as well as
+ # number of flows.
+ # ipv6:
+ # ipip-ipv4:
+ # track-parent-flow: true # disabled by default
+ # ipip-ipv6:
+ # track-parent-flow: true # disabled by default
##
## Performance tuning and profiling