chore: move some packages to pkg folder

This commit is contained in:
nadoo committed 2022-01-08 15:05:55 +08:00
1 parent a529261893
commit 1fd59a1677
82 files changed
+133 -123

No files matched your search

+16
View File
@@ -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)
})
}
}
+11
View File
@@ -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 }