mirror of
https://github.com/nadoo/glider.git
synced 2026-11-19 07:09:42 +08:00
chore: move some packages to pkg folder
This commit is contained in:
1 parent
a529261893
commit
1fd59a1677
82 files changed
+133
-123
No files matched your search
@@ -0,0 +1,16 @@
|
||||
package sockopt
|
||||
|
||||
import (
|
||||
"net"
|
||||
"syscall"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func BindControl(iface *net.Interface) func(network, address string, c syscall.RawConn) error {
|
||||
return func(network, address string, c syscall.RawConn) error {
|
||||
return c.Control(func(fd uintptr) {
|
||||
unix.BindToDevice(int(fd), iface.Name)
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
//go:build !linux
|
||||
// +build !linux
|
||||
|
||||
package sockopt
|
||||
|
||||
import (
|
||||
"net"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func BindControl(iface *net.Interface) func(string, string, syscall.RawConn) error { return nil }
|
||||
Reference in new issue
Block a user