Skip to content

Commit

Permalink
fix(cmake/modules): patch the max_consumers parameter of the
Browse files Browse the repository at this point in the history
kernel-module Falco driver

Co-authored-by: Lorenzo Fontana <[email protected]>
Signed-off-by: Leonardo Di Donato <[email protected]>
  • Loading branch information
leodido and fntlnz committed Nov 13, 2020
1 parent dada3db commit 60279c6
Showing 1 changed file with 33 additions and 4 deletions.
37 changes: 33 additions & 4 deletions cmake/modules/sysdig-repo/patch/libscap.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/userspace/libscap/scap.c b/userspace/libscap/scap.c
index e9faea51..a1b3b501 100644
index 6f51588e..401c6aed 100644
--- a/userspace/libscap/scap.c
+++ b/userspace/libscap/scap.c
@@ -52,7 +52,7 @@ limitations under the License.
@@ -55,7 +55,7 @@ limitations under the License.
//#define NDEBUG
#include <assert.h>

Expand All @@ -11,7 +11,16 @@ index e9faea51..a1b3b501 100644

//
// Probe version string size
@@ -171,7 +171,7 @@ scap_t* scap_open_live_int(char *error, int32_t *rc,
@@ -114,7 +114,7 @@ scap_t* scap_open_udig_int(char *error, int32_t *rc,
static uint32_t get_max_consumers()
{
uint32_t max;
- FILE *pfile = fopen("/sys/module/" PROBE_DEVICE_NAME "_probe/parameters/max_consumers", "r");
+ FILE *pfile = fopen("/sys/module/" PROBE_DEVICE_NAME "/parameters/max_consumers", "r");
if(pfile != NULL)
{
int w = fscanf(pfile, "%"PRIu32, &max);
@@ -186,7 +186,7 @@ scap_t* scap_open_live_int(char *error, int32_t *rc,
return NULL;
}

Expand All @@ -20,7 +29,27 @@ index e9faea51..a1b3b501 100644
bpf_probe = buf;
}
}
@@ -1808,7 +1808,7 @@ int32_t scap_disable_dynamic_snaplen(scap_t* handle)
@@ -344,7 +344,7 @@ scap_t* scap_open_live_int(char *error, int32_t *rc,
else if(errno == EBUSY)
{
uint32_t curr_max_consumers = get_max_consumers();
- snprintf(error, SCAP_LASTERR_SIZE, "Too many sysdig instances attached to device %s. Current value for /sys/module/" PROBE_DEVICE_NAME "_probe/parameters/max_consumers is '%"PRIu32"'.", filename, curr_max_consumers);
+ snprintf(error, SCAP_LASTERR_SIZE, "Too many sysdig instances attached to device %s. Current value for /sys/module/" PROBE_DEVICE_NAME "/parameters/max_consumers is '%"PRIu32"'.", filename, curr_max_consumers);
}
else
{
@@ -579,8 +579,8 @@ scap_t* scap_open_udig_int(char *error, int32_t *rc,
//
// Map the ppm_ring_buffer_info that contains the buffer pointers
//
- if(udig_alloc_ring_descriptors(&(handle->m_devs[0].m_bufinfo_fd),
- &handle->m_devs[0].m_bufinfo,
+ if(udig_alloc_ring_descriptors(&(handle->m_devs[0].m_bufinfo_fd),
+ &handle->m_devs[0].m_bufinfo,
&handle->m_devs[0].m_bufstatus,
error) != SCAP_SUCCESS)
{
@@ -2175,7 +2175,7 @@ int32_t scap_disable_dynamic_snaplen(scap_t* handle)

const char* scap_get_host_root()
{
Expand Down

0 comments on commit 60279c6

Please sign in to comment.