@@ -47,11 +47,11 @@ func applyOutboundSocketOptions(network string, address string, fd uintptr, conf
4747 }
4848 }
4949
50- if config .Interface != "" {
51- if err := syscall .BindToDevice (int (fd ), config .Interface ); err != nil {
52- return newError ("failed to set Interface" ).Base (err )
53- }
54- }
50+ if config .Interface != "" {
51+ if err := syscall .BindToDevice (int (fd ), config .Interface ); err != nil {
52+ return newError ("failed to set Interface" ).Base (err )
53+ }
54+ }
5555
5656 if isTCPSocket (network ) {
5757 tfo := config .ParseTFOValue ()
@@ -91,10 +91,10 @@ func applyOutboundSocketOptions(network string, address string, fd uintptr, conf
9191 }
9292
9393 if config .TcpWindowClamp > 0 {
94- if err := syscall .SetsockoptInt (int (fd ), syscall .IPPROTO_TCP , syscall .TCP_WINDOW_CLAMP , int (config .TcpWindowClamp )); err != nil {
95- return newError ("failed to set TCP_WINDOW_CLAMP" , err )
96- }
97- }
94+ if err := syscall .SetsockoptInt (int (fd ), syscall .IPPROTO_TCP , syscall .TCP_WINDOW_CLAMP , int (config .TcpWindowClamp )); err != nil {
95+ return newError ("failed to set TCP_WINDOW_CLAMP" , err )
96+ }
97+ }
9898 }
9999
100100 if config .Tproxy .IsEnabled () {
@@ -148,8 +148,8 @@ func applyInboundSocketOptions(network string, fd uintptr, config *SocketConfig)
148148
149149 if config .TcpWindowClamp > 0 {
150150 if err := syscall .SetsockoptInt (int (fd ), syscall .IPPROTO_TCP , syscall .TCP_WINDOW_CLAMP , int (config .TcpWindowClamp )); err != nil {
151- return newError ("failed to set TCP_WINDOW_CLAMP" , err )
152- }
151+ return newError ("failed to set TCP_WINDOW_CLAMP" , err )
152+ }
153153 }
154154 }
155155
0 commit comments