Skip to content

Commit 5381cf9

Browse files
committed
Revert key string change.
1 parent 3720428 commit 5381cf9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

service/udp.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ func (m *natmap) Get(key string) *natconn {
316316
return m.keyConn[key]
317317
}
318318

319-
func (m *natmap) set(clientAddr net.Addr, pc net.PacketConn, clientInfo ipinfo.IPInfo) *natconn {
319+
func (m *natmap) set(key string, pc net.PacketConn, clientInfo ipinfo.IPInfo) *natconn {
320320
entry := &natconn{
321321
PacketConn: pc,
322322
clientInfo: clientInfo,
@@ -326,7 +326,7 @@ func (m *natmap) set(clientAddr net.Addr, pc net.PacketConn, clientInfo ipinfo.I
326326
m.Lock()
327327
defer m.Unlock()
328328

329-
m.keyConn[clientAddr.String()] = entry
329+
m.keyConn[key] = entry
330330
return entry
331331
}
332332

@@ -343,7 +343,7 @@ func (m *natmap) del(key string) net.PacketConn {
343343
}
344344

345345
func (m *natmap) Add(clientAddr net.Addr, clientConn net.PacketConn, cryptoKey *shadowsocks.EncryptionKey, targetConn net.PacketConn, clientInfo ipinfo.IPInfo, keyID string) *natconn {
346-
entry := m.set(clientAddr, targetConn, clientInfo)
346+
entry := m.set(clientAddr.String(), targetConn, clientInfo)
347347

348348
m.metrics.AddUDPNatEntry(clientAddr, keyID)
349349
m.running.Add(1)

0 commit comments

Comments
 (0)