diff --git a/proxy/shadowsocks/protocol.go b/proxy/shadowsocks/protocol.go index 2ec1febf..2b51447f 100644 --- a/proxy/shadowsocks/protocol.go +++ b/proxy/shadowsocks/protocol.go @@ -92,6 +92,7 @@ func ReadRequest(reader io.Reader, auth *Authenticator, udp bool) (*Request, err nBytes, err := reader.Read(buffer.Value[lenBuffer:]) if err != nil { log.Error("Shadowsocks: Failed to read UDP payload: ", err) + return nil, transport.ErrorCorruptedPacket } buffer.Slice(0, lenBuffer+nBytes) if request.OTA { diff --git a/proxy/shadowsocks/shadowsocks.go b/proxy/shadowsocks/shadowsocks.go index a8fedec3..dbddaf9c 100644 --- a/proxy/shadowsocks/shadowsocks.go +++ b/proxy/shadowsocks/shadowsocks.go @@ -77,6 +77,7 @@ func (this *Shadowsocks) Listen(port v2net.Port) error { udpHub, err := hub.ListenUDP(port, this.handlerUDPPayload) if err != nil { log.Error("Shadowsocks: Failed to listen UDP on port ", port, ": ", err) + return err } this.udpHub = udpHub this.udpServer = hub.NewUDPServer(this.packetDispatcher)