From 1680284107279ee941097bc8653fb4c56e6c532c Mon Sep 17 00:00:00 2001 From: Yureka Date: Sat, 18 Nov 2023 17:41:40 +0100 Subject: [PATCH] set ttl --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index df66c8a..d2b99d6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -197,8 +197,9 @@ impl Daemon { let interface_names = config.peers.iter().map(|peer| peer.interface.clone()).collect::>(); let interfaces = interface_names.into_iter().map(|interface_name| wg_dump(&interface_name).map(|ifinfo| (interface_name, ifinfo))).collect::>>()?; - let socket = UdpSocket::bind(SocketAddr::new("0.0.0.0".parse()?, config.gossip_port))?; - socket.set_broadcast(true)?; + let socket = UdpSocket::bind(SocketAddr::new("[::]".parse()?, config.gossip_port))?; + //socket.set_broadcast(true)?; + socket.set_ttl(1)?; let peers = config.peers.iter().map(|peer_cfg| { (