diff --git a/constant/metadata.go b/constant/metadata.go index c0fe485..6399a41 100755 --- a/constant/metadata.go +++ b/constant/metadata.go @@ -87,7 +87,3 @@ func (m *Metadata) Network() string { func (m *Metadata) String() string { return m.DestinationAddress() } - -func (m *Metadata) Valid() bool { - return m.SrcIP != nil && m.DstIP != nil -} diff --git a/tunnel/tcp.go b/tunnel/tcp.go index 80e9499..a1f7aff 100755 --- a/tunnel/tcp.go +++ b/tunnel/tcp.go @@ -34,10 +34,6 @@ func handleTCP(localConn core.TCPConn) { DstIP: net.IP(id.LocalAddress), DstPort: id.LocalPort, } - if !metadata.Valid() { - log.Warnf("[Metadata] not valid: %#v", metadata) - return - } targetConn, err := proxy.Dial(metadata) if err != nil { diff --git a/tunnel/udp.go b/tunnel/udp.go index f54458b..d73a2f5 100755 --- a/tunnel/udp.go +++ b/tunnel/udp.go @@ -39,13 +39,9 @@ func handleUDP(packet core.UDPPacket) { DstIP: net.IP(id.LocalAddress), DstPort: id.LocalPort, } - if !metadata.Valid() { - log.Warnf("[Metadata] not valid: %#v", metadata) - return - } generateNATKey := func(m *M.Metadata) string { - return m.SourceAddress() /* Full Cone NAT Key */ + return m.SourceAddress() /* as Full Cone NAT Key */ } key := generateNATKey(metadata)