@@ -70,9 +70,9 @@ func UdpRoutingHandler(s *stack.Stack, state *State) func(*udp.ForwarderRequest)
7070
7171 go func () {
7272 if rf != nil {
73- RemoteForward (conn , & state . srcIPs , rf )
73+ RemoteForward (conn , state , rf )
7474 } else {
75- RoutingForward (conn , & state . srcIPs , loc )
75+ RoutingForward (conn , state , loc )
7676 }
7777 }()
7878 }
@@ -118,22 +118,22 @@ func TcpRoutingHandler(state *State) func(*tcp.ForwarderRequest) {
118118
119119 go func () {
120120 if rf != nil {
121- RemoteForward (conn , & state . srcIPs , rf )
121+ RemoteForward (conn , state , rf )
122122 } else {
123- RoutingForward (conn , & state . srcIPs , loc )
123+ RoutingForward (conn , state , loc )
124124 }
125125 }()
126126 }
127127 return h
128128}
129129
130- func RoutingForward (guest KaConn , srcIPs * SrcIPs , loc net.Addr ) {
130+ func RoutingForward (guest KaConn , state * State , loc net.Addr ) {
131131 // Cache guest.RemoteAddr() because it becomes nil on
132132 // guest.Close().
133133 guestRemoteAddr := guest .RemoteAddr ()
134134
135135 var pe ProxyError
136- xhost , err := OutboundDial (srcIPs , loc )
136+ xhost , err := OutboundDial (state , loc )
137137 if err != nil {
138138 SetResetOnClose (guest )
139139 guest .Close ()
@@ -173,7 +173,7 @@ func RoutingForward(guest KaConn, srcIPs *SrcIPs, loc net.Addr) {
173173 }
174174}
175175
176- func RemoteForward (guest KaConn , srcIPs * SrcIPs , rf * FwdAddr ) {
176+ func RemoteForward (guest KaConn , state * State , rf * FwdAddr ) {
177177 // Cache guest.RemoteAddr() because it becomes nil on
178178 // guest.Close().
179179 guestRemoteAddr := guest .RemoteAddr ()
@@ -190,7 +190,7 @@ func RemoteForward(guest KaConn, srcIPs *SrcIPs, rf *FwdAddr) {
190190 err )
191191 return
192192 }
193- xhost , err := OutboundDial (srcIPs , hostAddr )
193+ xhost , err := OutboundDial (state , hostAddr )
194194 if err != nil {
195195 SetResetOnClose (guest )
196196 guest .Close ()
0 commit comments