File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change
1
+ ## 0.6.0
2
+
3
+ - Skip port mapping when an active port mapping is present.
4
+ Previously, the behavior would skip creating new mappings if any mapping
5
+ (active or inactive or pending) existed for the same port. Now it correctly only
6
+ checks active mappings on the gateway.
7
+ See [ PR XXXX] ( https://github.com/libp2p/rust-libp2p/pull/XXXX ) .
8
+
1
9
## 0.5.0
2
10
3
11
- update igd-next to 0.16.1
Original file line number Diff line number Diff line change @@ -270,15 +270,14 @@ impl NetworkBehaviour for Behaviour {
270
270
return ;
271
271
} ;
272
272
273
- if let Some ( ( mapping, _state) ) = self
274
- . mappings
275
- . iter ( )
276
- . find ( |( mapping, _state) | mapping. internal_addr . port ( ) == addr. port ( ) )
277
- {
273
+ if let Some ( ( mapping, _state) ) = self . mappings . iter ( ) . find ( |( mapping, state) | {
274
+ matches ! ( state, MappingState :: Active ( _) )
275
+ && mapping. internal_addr . port ( ) == addr. port ( )
276
+ } ) {
278
277
tracing:: debug!(
279
278
multiaddress=%multiaddr,
280
279
mapped_multiaddress=%mapping. multiaddr,
281
- "port from multiaddress is already being mapped"
280
+ "port from multiaddress is already mapped on the gateway "
282
281
) ;
283
282
return ;
284
283
}
You can’t perform that action at this time.
0 commit comments