File tree 1 file changed +11
-12
lines changed
1 file changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -268,16 +268,15 @@ impl Punch {
268
268
}
269
269
let device_info = self . current_device . load ( ) ;
270
270
271
- nat_info. public_ips . retain ( |ip| {
272
- is_ipv4_global ( ip)
273
- && device_info. not_in_network ( * ip)
274
- } ) ;
271
+ nat_info
272
+ . public_ips
273
+ . retain ( |ip| is_ipv4_global ( ip) && device_info. not_in_network ( * ip) ) ;
275
274
nat_info. public_ports . retain ( |port| * port != 0 ) ;
276
275
nat_info. udp_ports . retain ( |port| * port != 0 ) ;
277
276
278
- nat_info. local_ipv4 = nat_info. local_ipv4 . filter ( |ip| {
279
- device_info . not_in_network ( * ip )
280
- } ) ;
277
+ nat_info. local_ipv4 = nat_info
278
+ . local_ipv4
279
+ . filter ( |ip| device_info . not_in_network ( * ip ) ) ;
281
280
282
281
if punch_tcp && self . punch_model . use_tcp ( ) && nat_info. tcp_port != 0 {
283
282
//向tcp发起连接
@@ -383,11 +382,11 @@ impl Punch {
383
382
}
384
383
let mut index = start
385
384
+ self . punch_symmetric (
386
- & self . port_vec [ start..end] ,
387
- buf,
388
- & nat_info. public_ips ,
389
- max_k2,
390
- ) ?;
385
+ & self . port_vec [ start..end] ,
386
+ buf,
387
+ & nat_info. public_ips ,
388
+ max_k2,
389
+ ) ?;
391
390
if index >= self . port_vec . len ( ) {
392
391
index = 0
393
392
}
You can’t perform that action at this time.
0 commit comments