feat: initial goget release — modern IPv6-first download utility
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
|
||||
package transport
|
||||
|
||||
import (
|
||||
"net"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// bindToInterface returns a Control function that binds connections
|
||||
// to the specified network interface using SO_BINDTODEVICE.
|
||||
func bindToInterface(iface string) func(string, string, syscall.RawConn) error {
|
||||
return func(network, address string, c syscall.RawConn) error {
|
||||
var err error
|
||||
c.Control(func(fd uintptr) {
|
||||
err = syscall.BindToDevice(int(fd), iface)
|
||||
})
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure net import is used
|
||||
var _ net.Conn
|
||||
Reference in New Issue
Block a user