Skip to content

Commit

Permalink
update condition to infer connection info to find local_addr if accep…
Browse files Browse the repository at this point in the history
…t/connect not traced

Signed-off-by: Benjamin Kilimnik <[email protected]>
  • Loading branch information
benkilimnik committed Jan 23, 2024
1 parent 2e030f7 commit a5d8b95
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/stirling/source_connectors/socket_tracer/conn_tracker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -795,9 +795,11 @@ void ConnTracker::IterationPreTick(
return;
}

// If remote_addr is missing, it means the connect/accept was not traced.
// Attempt to infer the connection information, to populate remote_addr.
if (open_info_.remote_addr.family == SockAddrFamily::kUnspecified && socket_info_mgr != nullptr) {
// If remote_addr or local_addr is missing, it means the connect/accept was not traced.
// Attempt to infer the connection information, to populate remote_addr and local_addr.
if ((open_info_.remote_addr.family == SockAddrFamily::kUnspecified ||
open_info_.local_addr.family == SockAddrFamily::kUnspecified) &&
socket_info_mgr != nullptr) {
InferConnInfo(proc_parser, socket_info_mgr);

// TODO(oazizi): If connection resolves to SockAddr type "Other",
Expand Down

0 comments on commit a5d8b95

Please sign in to comment.