diff --git a/cilium/bpf_metadata.h b/cilium/bpf_metadata.h index ae0c7d154..f956912b6 100644 --- a/cilium/bpf_metadata.h +++ b/cilium/bpf_metadata.h @@ -90,9 +90,11 @@ struct SocketMetadata : public Logger::Loggable { // Restoration of the original destination address lets the OriginalDstCluster know the // destination address that can be used. - ENVOY_LOG(trace, "cilium.bpf_metadata: restoreLocalAddress ({} -> {})", + ENVOY_LOG(trace, "Restoring local address (original destination) on socket {} ({} -> {})", + socket.ioHandle().fdDoNotUse(), socket.connectionInfoProvider().localAddress()->asString(), original_dest_address_->asString()); + socket.connectionInfoProvider().restoreLocalAddress(original_dest_address_); } diff --git a/cilium/socket_option_source_address.h b/cilium/socket_option_source_address.h index df7e38613..9234f665b 100644 --- a/cilium/socket_option_source_address.h +++ b/cilium/socket_option_source_address.h @@ -84,9 +84,14 @@ class SourceAddressSocketOption : public Network::Socket::Option, // Note: we don't expect this to change the behaviour of the socket. We expect it to be copied // into the upstream connection later. + ENVOY_LOG(trace, "Restoring local address (original source) on socket: {} ({} -> {})", + socket.ioHandle().fdDoNotUse(), + socket.connectionInfoProvider().localAddress() + ? socket.connectionInfoProvider().localAddress()->asString() + : "n/a", + source_address->asString()); + socket.connectionInfoProvider().setLocalAddress(std::move(source_address)); - ENVOY_LOG(trace, "Successfully restored local address on socket: {}", - socket.ioHandle().fdDoNotUse()); return true; }