|
|
@@ -112,7 +112,7 @@ func applyOutboundSocketOptions(network string, address string, fd uintptr, conf
|
|
|
|
|
|
if len(config.CustomSockopt) > 0 {
|
|
|
for _, custom := range config.CustomSockopt {
|
|
|
- if custom.System != "" && custom.System != runtime.GOOS{
|
|
|
+ if custom.System != "" && custom.System != runtime.GOOS {
|
|
|
errors.LogDebug(context.Background(), "CustomSockopt system not match: ", "want ", custom.System, " got ", runtime.GOOS)
|
|
|
continue
|
|
|
}
|
|
|
@@ -120,7 +120,7 @@ func applyOutboundSocketOptions(network string, address string, fd uintptr, conf
|
|
|
// network might be tcp4 or tcp6
|
|
|
// use HasPrefix so that "tcp" can match tcp4/6 with "tcp" if user want to control all tcp (udp is also the same)
|
|
|
// if it is empty, strings.HasPrefix will always return true to make it apply for all networks
|
|
|
- if !strings.HasPrefix(network, custom.Network){
|
|
|
+ if !strings.HasPrefix(network, custom.Network) {
|
|
|
continue
|
|
|
}
|
|
|
var level = 0x6 // default TCP
|
|
|
@@ -218,7 +218,7 @@ func applyInboundSocketOptions(network string, fd uintptr, config *SocketConfig)
|
|
|
}
|
|
|
if len(config.CustomSockopt) > 0 {
|
|
|
for _, custom := range config.CustomSockopt {
|
|
|
- if custom.System != "" && custom.System != runtime.GOOS{
|
|
|
+ if custom.System != "" && custom.System != runtime.GOOS {
|
|
|
errors.LogDebug(context.Background(), "CustomSockopt system not match: ", "want ", custom.System, " got ", runtime.GOOS)
|
|
|
continue
|
|
|
}
|
|
|
@@ -226,7 +226,7 @@ func applyInboundSocketOptions(network string, fd uintptr, config *SocketConfig)
|
|
|
// network might be tcp4 or tcp6
|
|
|
// use HasPrefix so that "tcp" can match tcp4/6 with "tcp" if user want to control all tcp (udp is also the same)
|
|
|
// if it is empty, strings.HasPrefix will always return true to make it apply for all networks
|
|
|
- if !strings.HasPrefix(network, custom.Network){
|
|
|
+ if !strings.HasPrefix(network, custom.Network) {
|
|
|
continue
|
|
|
}
|
|
|
var level = 0x6 // default TCP
|