mirror of
https://github.com/yggdrasil-network/water.git
synced 2025-05-19 16:35:10 +03:00
Add flags cIFF_MULTI_QUEUE
Signed-off-by: Tony Lu <tonyluj@gmail.com>
This commit is contained in:
parent
99d07fc117
commit
c14726aabc
2 changed files with 23 additions and 5 deletions
|
@ -10,9 +10,10 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
cIFF_TUN = 0x0001
|
||||
cIFF_TAP = 0x0002
|
||||
cIFF_NO_PI = 0x1000
|
||||
cIFF_TUN = 0x0001
|
||||
cIFF_TAP = 0x0002
|
||||
cIFF_NO_PI = 0x1000
|
||||
cIFF_MULTI_QUEUE = 0x0100
|
||||
)
|
||||
|
||||
type ifReq struct {
|
||||
|
@ -34,7 +35,13 @@ func newTAP(config Config) (ifce *Interface, err error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name, err := createInterface(file.Fd(), config.Name, cIFF_TAP|cIFF_NO_PI)
|
||||
|
||||
var flags uint16
|
||||
flags = cIFF_TUN | cIFF_NO_PI
|
||||
if config.PlatformSpecificParams.MultiQueue {
|
||||
flags = cIFF_TUN | cIFF_NO_PI | cIFF_MULTI_QUEUE
|
||||
}
|
||||
name, err := createInterface(file.Fd(), config.Name, flags)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -52,7 +59,13 @@ func newTUN(config Config) (ifce *Interface, err error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name, err := createInterface(file.Fd(), config.Name, cIFF_TUN|cIFF_NO_PI)
|
||||
|
||||
var flags uint16
|
||||
flags = cIFF_TUN | cIFF_NO_PI
|
||||
if config.PlatformSpecificParams.MultiQueue {
|
||||
flags = cIFF_TUN | cIFF_NO_PI | cIFF_MULTI_QUEUE
|
||||
}
|
||||
name, err := createInterface(file.Fd(), config.Name, flags)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue