Skip to content

Commit

Permalink
fix(sinsp): plugin capture listen capability exception
Browse files Browse the repository at this point in the history
Signed-off-by: Gianmatteo Palmieri <[email protected]>
Co-authored-by: Jason Dellaluce <[email protected]>
  • Loading branch information
2 people authored and poiana committed Sep 11, 2024
1 parent 215db2d commit 0f75722
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions userspace/libsinsp/sinsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,9 @@ void sinsp::open_common(scap_open_args* oargs,

// notify registered plugins of capture open
for(auto& p : m_plugin_manager->plugins()) {
p->capture_open();
if(p->caps() & CAP_CAPTURE_LISTENING) {
p->capture_open();
}
}
}

Expand Down Expand Up @@ -736,8 +738,12 @@ void sinsp::close() {
}

// notify registered plugins of capture close
for(auto& p : m_plugin_manager->plugins()) {
p->capture_close();
if(m_mode != SINSP_MODE_NONE) {
for(auto& p : m_plugin_manager->plugins()) {
if(p->caps() & CAP_CAPTURE_LISTENING) {
p->capture_close();
}
}
}

// purge pending routines and wait for the running ones
Expand Down

0 comments on commit 0f75722

Please sign in to comment.