Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions agent/src/ebpf/kernel/include/protocol_inference.h
Original file line number Diff line number Diff line change
Expand Up @@ -768,18 +768,25 @@ static __inline enum message_type infer_mysql_message(const char *buf,

if (conn_info->prev_count == 4) {
len = *(__u32 *) conn_info->prev_buf & 0x00ffffff;
if (len == count) {
seq = conn_info->prev_buf[3];
count += 4;
com = buf[0];
point_1 = buf[2];
point_2 = buf[4];
}
seq = conn_info->prev_buf[3];
count += 4;
com = buf[0];
point_1 = buf[2];
point_2 = buf[4];
Comment thread
kylewanginchina marked this conversation as resolved.
}

if (count < 5 || len == 0)
return MSG_UNKNOWN;

/*
* To prevent stale data from a previous map value remaining in
* the unused portion of `__infer_buf->data` when the current
* syscall provides fewer than 9 bytes of actual data.
*/
if (count < 9) {
point_1 = point_2 = 0;
}

bool is_mysqld = is_current_comm("mysqld");
if (is_socket_info_valid(conn_info->socket_info_ptr)) {
/*
Expand Down
Loading