mirror of
https://github.com/fumiama/water.git
synced 2026-06-12 22:40:30 +08:00
Use |=, instead of repeating flags
Signed-off-by: Tony Lu <tonyluj@gmail.com>
This commit is contained in:
@@ -39,7 +39,7 @@ func newTAP(config Config) (ifce *Interface, err error) {
|
|||||||
var flags uint16
|
var flags uint16
|
||||||
flags = cIFF_TUN | cIFF_NO_PI
|
flags = cIFF_TUN | cIFF_NO_PI
|
||||||
if config.PlatformSpecificParams.MultiQueue {
|
if config.PlatformSpecificParams.MultiQueue {
|
||||||
flags = cIFF_TUN | cIFF_NO_PI | cIFF_MULTI_QUEUE
|
flags |= cIFF_MULTI_QUEUE
|
||||||
}
|
}
|
||||||
name, err := createInterface(file.Fd(), config.Name, flags)
|
name, err := createInterface(file.Fd(), config.Name, flags)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -63,7 +63,7 @@ func newTUN(config Config) (ifce *Interface, err error) {
|
|||||||
var flags uint16
|
var flags uint16
|
||||||
flags = cIFF_TUN | cIFF_NO_PI
|
flags = cIFF_TUN | cIFF_NO_PI
|
||||||
if config.PlatformSpecificParams.MultiQueue {
|
if config.PlatformSpecificParams.MultiQueue {
|
||||||
flags = cIFF_TUN | cIFF_NO_PI | cIFF_MULTI_QUEUE
|
flags |= cIFF_MULTI_QUEUE
|
||||||
}
|
}
|
||||||
name, err := createInterface(file.Fd(), config.Name, flags)
|
name, err := createInterface(file.Fd(), config.Name, flags)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user