Skip to content

Commit 0616dfb

Browse files
committed
fix(unit-tests): fixes after adding arguments to recvmmsg and sendmmsg
Signed-off-by: Mauro Ezequiel Moltrasio <[email protected]>
1 parent 9860c46 commit 0616dfb

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

Diff for: driver/modern_bpf/programs/tail_called/events/syscall_dispatched_events/recvmmsg.bpf.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static long handle_exit(uint32_t index, void *ctx)
8383
* have in the buffer.
8484
*/
8585
uint16_t snaplen = maps__get_snaplen();
86-
apply_dynamic_snaplen(data->regs, &snaplen, true, NULL);
86+
apply_dynamic_snaplen(data->regs, &snaplen, true, PPME_SOCKET_RECVMMSG_X);
8787
if(snaplen > mmh.msg_len)
8888
{
8989
snaplen = mmh.msg_len;

Diff for: driver/modern_bpf/programs/tail_called/events/syscall_dispatched_events/sendmmsg.bpf.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static long handle_exit(uint32_t index, void *ctx)
145145
*/
146146
uint16_t snaplen = maps__get_snaplen();
147147
// TODO: check sockaddr
148-
apply_dynamic_snaplen(data->regs, &snaplen, true, NULL);
148+
apply_dynamic_snaplen(data->regs, &snaplen, true, PPME_SOCKET_SENDMMSG_X);
149149
if(mmh.msg_len > 0 && snaplen > mmh.msg_len)
150150
{
151151
snaplen = mmh.msg_len;

Diff for: userspace/libsinsp/test/public_sinsp_API/ppm_sc_codes.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,14 @@ const libsinsp::events::set<ppm_event_code> expected_sinsp_state_event_set = {
124124
PPME_SOCKET_RECVFROM_X,
125125
PPME_SOCKET_RECVMSG_E,
126126
PPME_SOCKET_RECVMSG_X,
127+
PPME_SOCKET_RECVMMSG_E,
128+
PPME_SOCKET_RECVMMSG_X,
127129
PPME_SOCKET_GETSOCKOPT_E,
128130
PPME_SOCKET_GETSOCKOPT_X,
129131
PPME_SOCKET_SENDMSG_E,
130132
PPME_SOCKET_SENDMSG_X,
133+
PPME_SOCKET_SENDMMSG_E,
134+
PPME_SOCKET_SENDMMSG_X,
131135
PPME_SOCKET_SENDTO_E,
132136
PPME_SOCKET_SENDTO_X,
133137
PPME_SYSCALL_SETGID_E,
@@ -254,8 +258,10 @@ const libsinsp::events::set<ppm_sc_code> expected_sinsp_state_sc_set = {
254258
PPM_SC_PRLIMIT64,
255259
PPM_SC_RECVFROM,
256260
PPM_SC_RECVMSG,
261+
PPM_SC_RECVMMSG,
257262
PPM_SC_GETSOCKOPT,
258263
PPM_SC_SENDMSG,
264+
PPM_SC_SENDMMSG,
259265
PPM_SC_SENDTO,
260266
PPM_SC_SETGID,
261267
PPM_SC_SETGID32,

0 commit comments

Comments
 (0)