From 75d51be659909d02070fd7131e0d19c8bc7deebb Mon Sep 17 00:00:00 2001 From: EAimTY Date: Sun, 31 Jul 2022 00:47:42 +0900 Subject: [PATCH] using IPv6 on server outbound UDP sockets --- server/src/connection/udp.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/connection/udp.rs b/server/src/connection/udp.rs index d89fb24..77226a8 100644 --- a/server/src/connection/udp.rs +++ b/server/src/connection/udp.rs @@ -5,7 +5,7 @@ use parking_lot::Mutex; use std::{ collections::HashMap, io::Result, - net::{Ipv4Addr, SocketAddr}, + net::{Ipv6Addr, SocketAddr}, sync::Arc, }; use tokio::{ @@ -124,7 +124,7 @@ impl UdpSession { src_addr: SocketAddr, max_pkt_size: usize, ) -> Result { - let socket = Arc::new(UdpSocket::bind(SocketAddr::from((Ipv4Addr::UNSPECIFIED, 0))).await?); + let socket = Arc::new(UdpSocket::bind(SocketAddr::from((Ipv6Addr::UNSPECIFIED, 0))).await?); let (send_pkt_tx, send_pkt_rx) = mpsc::channel(1); tokio::spawn(async move {