mirror of
https://github.com/SagerNet/sing.git
synced 2025-04-05 21:07:41 +03:00
Fix create packet conn
This commit is contained in:
parent
f6144cded5
commit
605697c1ae
1 changed files with 2 additions and 2 deletions
|
@ -305,7 +305,7 @@ func NewPacketConn(conn net.PacketConn) N.NetPacketConn {
|
|||
} else if udpConn, ok := conn.(*net.UDPConn); ok {
|
||||
return &ExtendedUDPConn{udpConn}
|
||||
} else {
|
||||
return &ExtendedPacketConn{udpConn}
|
||||
return &ExtendedPacketConn{conn}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -343,7 +343,7 @@ type ExtendedPacketConn struct {
|
|||
}
|
||||
|
||||
func (w *ExtendedPacketConn) ReadPacket(buffer *buf.Buffer) (M.Socksaddr, error) {
|
||||
_, addr, err := ReadFrom(w, buffer)
|
||||
_, addr, err := buffer.ReadPacketFrom(w)
|
||||
if err != nil {
|
||||
return M.Socksaddr{}, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue