From a8a25a9b4ced294c4c518d1cbef889b0bd7b33b1 Mon Sep 17 00:00:00 2001 From: atavism Date: Mon, 23 Sep 2024 08:16:06 -0700 Subject: [PATCH] Additional clean-ups --- ipproxy.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ipproxy.go b/ipproxy.go index 89cf613..253c9de 100644 --- a/ipproxy.go +++ b/ipproxy.go @@ -227,13 +227,13 @@ func (p *proxy) Start(ctx context.Context) error { // tcpReceiveBufferSize if set to zero, the default receive window buffer size is used instead. const tcpReceiveBufferSize = 0 const maxInFlightConnectionAttempts = 1024 - tcpFwd := tcp.NewForwarder(p.ipstack, tcpReceiveBufferSize, maxInFlightConnectionAttempts, p.onTCP) - udpFwd := udp.NewForwarder(p.ipstack, p.onUDP) + tcpFwd := tcp.NewForwarder(ipstack, tcpReceiveBufferSize, maxInFlightConnectionAttempts, p.onTCP) + udpFwd := udp.NewForwarder(ipstack, p.onUDP) - p.ipstack.SetTransportProtocolHandler(tcp.ProtocolNumber, tcpFwd.HandlePacket) - p.ipstack.SetTransportProtocolHandler(udp.ProtocolNumber, udpFwd.HandlePacket) + ipstack.SetTransportProtocolHandler(tcp.ProtocolNumber, tcpFwd.HandlePacket) + ipstack.SetTransportProtocolHandler(udp.ProtocolNumber, udpFwd.HandlePacket) - p.ipstack.Wait() + ipstack.Wait() return nil }