Skip to content

Commit a5d8b95

Browse files
committed
update condition to infer connection info to find local_addr if accept/connect not traced
Signed-off-by: Benjamin Kilimnik <bkilimnik@pixielabs.ai>
1 parent 2e030f7 commit a5d8b95

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/stirling/source_connectors/socket_tracer/conn_tracker.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -795,9 +795,11 @@ void ConnTracker::IterationPreTick(
795795
return;
796796
}
797797

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

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

0 commit comments

Comments
 (0)