From f06a97ff509e0ebe45bf1c94e616f581a9816cfe Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Wed, 15 Apr 2026 15:49:48 +0800 Subject: [PATCH] fix udpHole --- Tun/Punchnet/SDLUDPHole.swift | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/Tun/Punchnet/SDLUDPHole.swift b/Tun/Punchnet/SDLUDPHole.swift index 4d65b28..34fcbdf 100644 --- a/Tun/Punchnet/SDLUDPHole.swift +++ b/Tun/Punchnet/SDLUDPHole.swift @@ -38,19 +38,6 @@ final class SDLUDPHole: ChannelInboundHandler { } func start() throws -> SocketAddress { - switch self.state { - case .ready: - guard let channel = self.channel else { - preconditionFailure("SDLUDPHole is ready but channel is nil") - } - precondition(channel.localAddress != nil, "UDP channel has no localAddress after bind") - return channel.localAddress! - case .stopping, .stopped: - preconditionFailure("SDLUDPHole cannot be restarted after stop") - case .idle: - break - } - let bootstrap = DatagramBootstrap(group: group) .channelOption(ChannelOptions.socketOption(.so_reuseaddr), value: 1) .channelInitializer { channel in