aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2021-10-19 12:07:47 +0200
committerGitHub <noreply@github.com>2021-10-19 12:07:47 +0200
commitfea3991ad168ee0a69a35c7be15e0732f2351d56 (patch)
tree6d3d75a811a609bca59562f1fc84c7c739c0f78b /src/include
parent06f13fd2de45237b0643b2a26c76f57967b8e93e (diff)
Fix some invalid memory reads (#1350)
`ndpi_detection_giveup()` (and any functions called by it) can't access `ndpi_detection_module_struct->packet` anymore since 730c236. Sync unit tests results Close #1348
Diffstat (limited to 'src/include')
-rw-r--r--src/include/ndpi_typedefs.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h
index fe32bfd97..b55224be2 100644
--- a/src/include/ndpi_typedefs.h
+++ b/src/include/ndpi_typedefs.h
@@ -1198,7 +1198,7 @@ struct ndpi_flow_struct {
/* init parameter, internal used to set up timestamp,... */
u_int16_t guessed_protocol_id, guessed_host_protocol_id, guessed_category, guessed_header_category;
u_int8_t l4_proto, protocol_id_already_guessed:1, host_already_guessed:1, fail_with_unknown:1,
- init_finished:1, setup_packet_direction:1, packet_direction:1, check_extra_packets:1;
+ init_finished:1, setup_packet_direction:1, packet_direction:1, check_extra_packets:1, is_ipv6:1;
/*
if ndpi_struct->direction_detect_disable == 1
@@ -1206,6 +1206,11 @@ struct ndpi_flow_struct {
*/
u_int32_t next_tcp_seq_nr[2];
+ /* Flow addresses (used mainly for LRU lookups in ndpi_detection_giveup())
+ * TODO: ipv6. Note that LRU is ipv4 only, for the time being */
+ u_int32_t saddr;
+ u_int32_t daddr;
+
// -----------------------------------------
u_int8_t max_extra_packets_to_check;
@@ -1214,6 +1219,8 @@ struct ndpi_flow_struct {
int (*extra_packets_func) (struct ndpi_detection_module_struct *, struct ndpi_flow_struct *flow);
+ u_int64_t last_packet_time_ms;
+
/*
the tcp / udp / other l4 value union
used to reduce the number of bytes for tcp or udp protocol states
@@ -1415,9 +1422,6 @@ struct ndpi_flow_struct {
u_int8_t ovpn_session_id[8];
u_int8_t ovpn_counter;
- /* Flow key used to search a match into the mining cache */
- u_int32_t key_mining_cache;
-
/* NDPI_PROTOCOL_TINC */
u_int8_t tinc_state;
struct tinc_cache_entry tinc_cache_entry;