@@ -323,29 +323,23 @@ impl LinkManagerMulticastUdp {
323
323
324
324
// If TTL is specified, add set the socket's TTL
325
325
if let Some ( ttl_str) = config. get ( UDP_MULTICAST_TTL ) {
326
- let ttl = match ttl_str. parse :: < u32 > ( ) {
327
- Ok ( ttl) => ttl,
328
- Err ( e) => bail ! ( "Can not parse TTL '{}' to a u32: {}" , ttl_str, e) ,
329
- } ;
330
-
331
326
match & local_addr {
332
327
IpAddr :: V4 ( _) => {
333
- ucast_sock
334
- . set_multicast_ttl_v4 ( ttl)
335
- . map_err ( |e| zerror ! ( "{}: {}" , mcast_addr, e) ) ?;
328
+ let ttl = match ttl_str. parse :: < u32 > ( ) {
329
+ Ok ( ttl) => ttl,
330
+ Err ( e) => bail ! ( "Can not parse TTL '{}' to a u32: {}" , ttl_str, e) ,
331
+ } ;
332
+
333
+ ucast_sock. set_multicast_ttl_v4 ( ttl) . map_err ( |e| {
334
+ zerror ! ( "Can not set multicast TTL {} on {}: {}" , ttl, mcast_addr, e)
335
+ } ) ?;
336
336
}
337
- IpAddr :: V6 ( _) => match zenoh_util:: net:: get_index_of_interface ( local_addr) {
338
- Ok ( _) => {
339
- tracing:: warn!(
340
- "set_multicast_ttl_v4 on v6 socket (may have no effect): {}" ,
337
+ IpAddr :: V6 ( _) => {
338
+ tracing:: warn!(
339
+ "UDP multicast hop limit not supported for v6 socket: {}. See https://github.com/rust-lang/rust/pull/138744." ,
341
340
mcast_addr
342
341
) ;
343
- ucast_sock
344
- . set_multicast_ttl_v4 ( ttl)
345
- . map_err ( |e| zerror ! ( "{}: {}" , mcast_addr, e) ) ?
346
- }
347
- Err ( e) => bail ! ( "{}: {}" , mcast_addr, e) ,
348
- } ,
342
+ }
349
343
}
350
344
}
351
345
0 commit comments