mirror of
https://github.com/SagerNet/sing.git
synced 2025-04-05 04:47:40 +03:00
Improve bind
This commit is contained in:
parent
185d879182
commit
d4ba8fdfac
5 changed files with 14 additions and 13 deletions
|
@ -16,9 +16,9 @@ func BindToInterface(manager BindManager, interfaceName string) Func {
|
|||
}
|
||||
}
|
||||
|
||||
func BindToInterfaceFunc(manager BindManager, interfaceNameFunc func() string) Func {
|
||||
func BindToInterfaceFunc(manager BindManager, interfaceNameFunc func(network, address string) string) Func {
|
||||
return func(network, address string, conn syscall.RawConn) error {
|
||||
interfaceName := interfaceNameFunc()
|
||||
interfaceName := interfaceNameFunc(network, address)
|
||||
if interfaceName == "" {
|
||||
return nil
|
||||
}
|
||||
|
@ -28,6 +28,6 @@ func BindToInterfaceFunc(manager BindManager, interfaceNameFunc func() string) F
|
|||
}
|
||||
}
|
||||
|
||||
func BindToInterfaceIndexFunc(interfaceIndexFunc func() int) Func {
|
||||
func BindToInterfaceIndexFunc(interfaceIndexFunc func(network, address string) int) Func {
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue