mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Merge pull request #9283 from tianyuzhou95:albert-socket
PiperOrigin-RevId: 557865949
This commit is contained in:
@@ -359,8 +359,8 @@ type socketEntry struct {
|
||||
// fd.
|
||||
func createSocket(iface net.Interface, ifaceLink netlink.Link, enableGSO bool) (*socketEntry, error) {
|
||||
// Create the socket.
|
||||
const protocol = 0x0300 // htons(ETH_P_ALL)
|
||||
fd, err := unix.Socket(unix.AF_PACKET, unix.SOCK_RAW, protocol)
|
||||
const protocol = 0x0300 // htons(ETH_P_ALL)
|
||||
fd, err := unix.Socket(unix.AF_PACKET, unix.SOCK_RAW, 0) // pass protocol 0 to avoid slow bind()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to create raw socket: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user