Skip to content

Commit

Permalink
disable IFF_VNET_HDR
Browse files Browse the repository at this point in the history
  • Loading branch information
hhd committed Feb 23, 2024
1 parent f8aee65 commit 8c6f57e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tun/tun_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import (
"time"
"unsafe"

"github.com/openp2p-cn/wireguard-go/conn"
"github.com/openp2p-cn/wireguard-go/rwcancel"
"golang.org/x/sys/unix"
"golang.zx2c4.com/wireguard/conn"
"golang.zx2c4.com/wireguard/rwcancel"
)

const (
Expand Down Expand Up @@ -551,7 +551,7 @@ func CreateTUN(name string, mtu int) (Device, error) {
// IFF_VNET_HDR enables the "tun status hack" via routineHackListener()
// where a null write will return EINVAL indicating the TUN is up.
// ifr.SetUint16(unix.IFF_TUN | unix.IFF_NO_PI | unix.IFF_VNET_HDR)
ifr.SetUint16(unix.IFF_TUN | unix.IFF_NO_PI)
ifr.SetUint16(unix.IFF_TUN | unix.IFF_NO_PI) // disable IFF_VNET_HDR
err = unix.IoctlIfreq(nfd, unix.TUNSETIFF, ifr)
if err != nil {
return nil, err
Expand Down

0 comments on commit 8c6f57e

Please sign in to comment.