Give each stream its own ethertype steered to its own rx queue
This commit is contained in:
@@ -56,7 +56,7 @@ func openTxSocket(ifindex int) (int, error) {
|
||||
return fd, nil
|
||||
}
|
||||
|
||||
func openRxSocket(ifindex, fanoutID, fanoutMode int) (int, error) {
|
||||
func openRxSocket(ifindex int, etherType uint16) (int, error) {
|
||||
proto := int(htons(etherType))
|
||||
fd, err := unix.Socket(unix.AF_PACKET, unix.SOCK_RAW, proto)
|
||||
if err != nil {
|
||||
@@ -82,13 +82,6 @@ func openRxSocket(ifindex, fanoutID, fanoutMode int) (int, error) {
|
||||
unix.Close(fd)
|
||||
return -1, fmt.Errorf("rcvtimeo: %w", err)
|
||||
}
|
||||
if fanoutMode >= 0 {
|
||||
arg := (fanoutMode << 16) | (fanoutID & 0xffff)
|
||||
if err := unix.SetsockoptInt(fd, unix.SOL_PACKET, unix.PACKET_FANOUT, arg); err != nil {
|
||||
unix.Close(fd)
|
||||
return -1, fmt.Errorf("fanout: %w", err)
|
||||
}
|
||||
}
|
||||
return fd, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user