Skip to content

Commit

Permalink
fix(unit-tests): fixes after adding arguments to recvmmsg and sendmmsg
Browse files Browse the repository at this point in the history
Signed-off-by: Mauro Ezequiel Moltrasio <mmoltras@redhat.com>
  • Loading branch information
Molter73 committed Aug 28, 2024
1 parent 9860c46 commit 0616dfb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static long handle_exit(uint32_t index, void *ctx)
* have in the buffer.
*/
uint16_t snaplen = maps__get_snaplen();
apply_dynamic_snaplen(data->regs, &snaplen, true, NULL);
apply_dynamic_snaplen(data->regs, &snaplen, true, PPME_SOCKET_RECVMMSG_X);
if(snaplen > mmh.msg_len)
{
snaplen = mmh.msg_len;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ static long handle_exit(uint32_t index, void *ctx)
*/
uint16_t snaplen = maps__get_snaplen();
// TODO: check sockaddr
apply_dynamic_snaplen(data->regs, &snaplen, true, NULL);
apply_dynamic_snaplen(data->regs, &snaplen, true, PPME_SOCKET_SENDMMSG_X);
if(mmh.msg_len > 0 && snaplen > mmh.msg_len)
{
snaplen = mmh.msg_len;
Expand Down
6 changes: 6 additions & 0 deletions userspace/libsinsp/test/public_sinsp_API/ppm_sc_codes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,14 @@ const libsinsp::events::set<ppm_event_code> expected_sinsp_state_event_set = {
PPME_SOCKET_RECVFROM_X,
PPME_SOCKET_RECVMSG_E,
PPME_SOCKET_RECVMSG_X,
PPME_SOCKET_RECVMMSG_E,
PPME_SOCKET_RECVMMSG_X,
PPME_SOCKET_GETSOCKOPT_E,
PPME_SOCKET_GETSOCKOPT_X,
PPME_SOCKET_SENDMSG_E,
PPME_SOCKET_SENDMSG_X,
PPME_SOCKET_SENDMMSG_E,
PPME_SOCKET_SENDMMSG_X,
PPME_SOCKET_SENDTO_E,
PPME_SOCKET_SENDTO_X,
PPME_SYSCALL_SETGID_E,
Expand Down Expand Up @@ -254,8 +258,10 @@ const libsinsp::events::set<ppm_sc_code> expected_sinsp_state_sc_set = {
PPM_SC_PRLIMIT64,
PPM_SC_RECVFROM,
PPM_SC_RECVMSG,
PPM_SC_RECVMMSG,
PPM_SC_GETSOCKOPT,
PPM_SC_SENDMSG,
PPM_SC_SENDMMSG,
PPM_SC_SENDTO,
PPM_SC_SETGID,
PPM_SC_SETGID32,
Expand Down

0 comments on commit 0616dfb

Please sign in to comment.