Merge pull request #9283 from tianyuzhou95:albert-socket

PiperOrigin-RevId: 557865949
This commit is contained in:
gVisor bot
2023-08-17 10:32:58 -07:00
+2 -2
View File
@@ -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)
}