add dummy functions for other platforms

This commit is contained in:
Arceliar 2019-10-25 19:32:53 -05:00
parent bcacfb0638
commit 710815fed5
4 changed files with 10 additions and 2 deletions

View File

@ -299,7 +299,7 @@ func (t *tcp) call(saddr string, options interface{}, sintf string, upgrade *Tcp
Timeout: time.Second * 5, Timeout: time.Second * 5,
} }
if sintf != "" { if sintf != "" {
dialer.Control = t.getContextWithBindToDevice(sintf) dialer.Control = t.getControl(sintf)
ief, err := net.InterfaceByName(sintf) ief, err := net.InterfaceByName(sintf)
if err != nil { if err != nil {
return return

View File

@ -26,3 +26,7 @@ func (t *tcp) tcpContext(network, address string, c syscall.RawConn) error {
return control return control
} }
} }
func (t *tcp) getControl(sintf string) func(string, string, syscall.RawConn) error {
return t.tcpContext
}

View File

@ -30,7 +30,7 @@ func (t *tcp) tcpContext(network, address string, c syscall.RawConn) error {
return nil return nil
} }
func (t *tcp) getContextWithBindToDevice(sintf string) func(string, string, syscall.RawConn) error { func (t *tcp) getControl(sintf string) func(string, string, syscall.RawConn) error {
return func(network, address string, c syscall.RawConn) error { return func(network, address string, c syscall.RawConn) error {
var err error var err error
btd := func(fd uintptr) { btd := func(fd uintptr) {

View File

@ -11,3 +11,7 @@ import (
func (t *tcp) tcpContext(network, address string, c syscall.RawConn) error { func (t *tcp) tcpContext(network, address string, c syscall.RawConn) error {
return nil return nil
} }
func (t *tcp) getControl(sintf string) func(string, string, syscall.RawConn) error {
return t.tcpContext
}