mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2024-12-30 02:37:01 +00:00
Fix: decrease packet reference (#106)
ref: https://github.com/google/gvisor/commit/f375784d83852b1e3ff20cc9de0648b3c0cf8525
This commit is contained in:
@@ -103,7 +103,7 @@ func (e *Endpoint) dispatchLoop(cancel context.CancelFunc) {
|
||||
case header.IPv6Version:
|
||||
e.InjectInbound(header.IPv6ProtocolNumber, pkt)
|
||||
}
|
||||
pkt.DecRef() /* release */
|
||||
pkt.DecRef()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,6 +121,8 @@ func (e *Endpoint) outboundLoop(ctx context.Context) {
|
||||
|
||||
// writePacket writes outbound packets to the io.Writer.
|
||||
func (e *Endpoint) writePacket(pkt *stack.PacketBuffer) tcpip.Error {
|
||||
defer pkt.DecRef()
|
||||
|
||||
size := pkt.Size()
|
||||
views := pkt.Views()
|
||||
if e.offset != 0 {
|
||||
|
||||
Reference in New Issue
Block a user