@@ -276,16 +276,21 @@ impl Behaviour {
276
276
{
277
277
// Apply address translation to the candidate address.
278
278
// For TCP without port-reuse, the observed address contains an ephemeral port which needs to be replaced by the port of a listen address.
279
+ tracing:: info!( ">>> translating ephemeral address {observed:?}" ) ;
279
280
let translated_addresses = {
280
281
let mut addrs: Vec < _ > = self
281
282
. listen_addresses
282
283
. iter ( )
283
284
. filter_map ( |server| {
285
+ tracing:: info!( "> translating to listen address {server:?}" ) ;
284
286
if ( is_tcp_addr ( server) && is_tcp_addr ( observed) )
285
287
|| ( is_quic_addr ( server, true ) && is_quic_addr ( observed, true ) )
286
288
|| ( is_quic_addr ( server, false ) && is_quic_addr ( observed, false ) )
287
289
{
288
- _address_translation ( server, observed)
290
+ let translated = _address_translation ( server, observed) ;
291
+ tracing:: info!( "> translated to {translated:?}" ) ;
292
+
293
+ translated
289
294
} else {
290
295
None
291
296
}
@@ -298,6 +303,8 @@ impl Behaviour {
298
303
addrs
299
304
} ;
300
305
306
+ tracing:: info!( "> translated addresses {translated_addresses:?}" ) ;
307
+
301
308
// If address translation yielded nothing, broadcast the original candidate address.
302
309
if translated_addresses. is_empty ( ) {
303
310
self . events
@@ -313,6 +320,7 @@ impl Behaviour {
313
320
314
321
// outgoing connection dialed with port reuse
315
322
// incomming connection
323
+ tracing:: info!( ">>> skipping translation for port-reuse address {observed:?}" ) ;
316
324
self . events
317
325
. push_back ( ToSwarm :: NewExternalAddrCandidate ( observed. clone ( ) ) ) ;
318
326
}
0 commit comments